MYSQL Help Error
#1

Code:
GetPlayerName(playerid, Name, sizeof(Name));
mysql_query("SELECT `password` FROM `player` WHERE `username`=`%s`", Name);
Code:
H:\RP\filterscripts\msql.pwn(218) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Hello,

I would like to know what i have done incorrectly in this code to result in the error

Thanks
Reply
#2

You cannot use mysql_query like you use format. You need to use format() to format a string first, and then mysql_query(the string you formatted).
Reply
#3

so like
Code:
format(str, sizeof(str), "SELECT `password` FROM `player` WHERE `username` = `%s`", Name);
mysql_query(str);
thanks
Reply
#4

Quote:
Originally Posted by wilko1995
View Post
so like
Code:
format(str, sizeof(str), "SELECT `password` FROM `player` WHERE `username` = `%s`", Name);
mysql_query(str);
thanks
Exactly,

but here in WHERE `username` = `%s`

it should be WHERE `username` = '%s'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)