SA-MP Forums Archive
mySQL - query problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mySQL - query problem (/showthread.php?tid=307785)



mySQL - query problem - V_LOPE - 01.01.2012

well...
When i Compile it..
in this code
pawn Код:
mysql_query("INSERT INTO `users` (`username`, `password`) VALUES ('%s', MD5('%s'))",PlayerName2(playerid),password);
i got this error:
Код:
error 035: argument type mismatch (argument 2)
how i can fix this?


Re: mySQL - query problem - -Prodigy- - 01.01.2012

You need to format the string then query it:
pawn Код:
new
    gQuery[256];

format(gQuery, sizeof(gQuery), "INSERT INTO `users` (`username`, `password`) VALUES ('%s', MD5('%s'))",PlayerName2(playerid),password);
mysql_query(gQuery);



Re: mySQL - query problem - V_LOPE - 01.01.2012

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
You need to format the string then query it:
pawn Код:
new
    gQuery[256];

format(gQuery, sizeof(gQuery), "INSERT INTO `users` (`username`, `password`) VALUES ('%s', MD5('%s'))",PlayerName2(playerid),password);
mysql_query(gQuery);
thanks it work! +rep