Help with mysql format
#3

You have queries in which you have a %s specifier, but you don't supply any variable after your query to replace the %s with.

Like this:
pawn Код:
mysql_format(SQL_db, Query, sizeof(Query), "SELECT * FROM playerdata WHERE PlayerName = '%s'");
The %s must be replaced by some value stored in a variable, but after the query, you don't specify a variable that contains the data, which should be inserted where the %s is located.

This would be correct:
pawn Код:
new Name[24];
GetPlayerName(playerid, Name, sizeof(Name));
mysql_format(SQL_db, Query, sizeof(Query), "SELECT * FROM playerdata WHERE PlayerName = '%s'", Name);
As the player's name would be stored in the "Name" variable and will be inserted at the location of the %s.
Reply


Messages In This Thread
Help with mysql format - by MrViolence101 - 08.01.2015, 12:24
Re: Help with mysql format - by Vince - 08.01.2015, 12:52
Re: Help with mysql format - by PowerPC603 - 08.01.2015, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)