PDA

View Full Version : mySQL - query problem


V_LOPE
01/01/2012, 05:31 AM
well...
When i Compile it..
in this code
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?

-Prodigy-
01/01/2012, 06:00 AM
You need to format the string then query it:new
gQuery[256];

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

V_LOPE
01/01/2012, 06:12 AM
You need to format the string then query it: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