MySQL saving
#4

Quote:
Originally Posted by Pedro_Miranda
Посмотреть сообщение
mysql_format + mysql_function_query
Quote:
Originally Posted by Hawky133
Посмотреть сообщение
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);
ok i know what iv done wrong
i didnt event know that function before it was a simple format
anyways tnx
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: 1 Guest(s)