MySQL saving
#3

Hello.

You need to format your query BEFORE you use it in mysql_function_query. Right now, your query is doing this:

Username=%s
Money=%d
Score=%d
IP=%s
TOS=%s


You need to format your string before this point like this:
pawn Код:
new query[256];
mysql_format(connectionHandle,query,"INSERT INTO memmbers (Username, Money, Score, IP, TOS) VALUES ('%s','%d','%d','%s','%s')",pname,GetPlayerMoney(playerid), GetPlayerScore(playerid), IP,TStr);
//Where connectionHandleis the ID of your connection to the mysql database
And then you can run the query:
pawn Код:
mysql_function_query(connectionHandle,query,false,"OnQueryFinish","siiss",pname,GetPlayerMoney(playerid), GetPlayerScore(playerid), IP,TStr);
Reply


Messages In This Thread
MySQL saving - by park4bmx - 25.06.2012, 17:05
Re: MySQL saving - by Jason` - 25.06.2012, 17:18
Re: MySQL saving - by Hawky133 - 25.06.2012, 17:24
Re: MySQL saving - by park4bmx - 25.06.2012, 17:27
Re: MySQL saving - by dowster - 25.06.2012, 18:40
Re: MySQL saving - by park4bmx - 25.06.2012, 20:25

Forum Jump:


Users browsing this thread: 3 Guest(s)