Insert into `kicks` problem
#1

Hello, i have made a kick system and if you kick the player it should display on the database, but there's a problem.

Here is the code:

PHP код:
mysql_format(DatabaseDB_Querysizeof(DB_Query), "INSERT INTO `kicks` (`Name`, `KickedBy`, `Reason`, `IpAddress`)\
     VALUES (`%s`, `%s`, `%s`, `%s`)"
GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reasonplayerip);
    
mysql_tquery(DatabaseDB_Query); 
There was no errors when i compiled it, but it just doesn't insert the data into the "kicks" table.
Reply
#2

Don't use backticks for values. It's suppose to be an apostrophe.

Also, use '%e' to escape strings.
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Don't use backticks for values. It's suppose to be an apostrophe.

Also, use '%e' to escape strings.
PHP код:
mysql_format(DatabaseDB_Querysizeof(DB_Query), "INSERT INTO `kicks` (`Name`, `KickedBy`, `Reason`, `IpAddress`)\
     VALUES (%e, %e, %e, %e)"
GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reasonplayerip);
    
mysql_tquery(DatabaseDB_Query); 
So this should work?
Reply
#4

'%e' instead of %e and it should work, yes.
Reply
#5

It works, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)