19.03.2011, 18:47
Well like the title says, how do do this ?
I have a peace of code on my your sql include using this method:
Function:
Usage:
Which i want to convert to:
Usage:
I know this can be done using getargs(), setargs() and numargs(), i tried it but i just cant get it to work. My test code :http://pastebin.com/CYz6FR80
I have a peace of code on my your sql include using this method:
Function:
pawn Код:
stock yoursql_insert(table[],values[])
{
new query[256];format(query,sizeof query,"INSERT INTO %s (%s) VALUES (%s)",table,GetStructure(table),values);
return mysql_query(query,-1,-1,connection);
}
pawn Код:
new string[128];
format(string,sizeof string,"'%s',%i,%i",yoursql_escape_string(PlayerInfo[playerid][UserName]),PlayerInfo[playerid][money],PlayerInfo[playerid][score]);
yoursql_insert("users",string)
Usage:
pawn Код:
yoursql_insert("users","sii",yoursql_escape_string(PlayerInfo[playerid][UserName]),PlayerInfo[playerid][money],PlayerInfo[playerid]);