18.05.2010, 14:19
You don't do it like that.
If query gets any result then password was corrent and if it's doesn't it wasn't. I also suggest you to use MD5 hash (if you don't hash passwords with anything else).
And I also suggest you to use threads for all queries for better performance.
pawn Код:
new string[128];
mysql_real_escape_string(password,password);
format(string,sizeof(string),"SELECT * FROM users WHERE username='%s' AND password='%s' LIMIT 1", GetName(playerid),password);
mysql_query(string);
Код:
SELECT * FROM users WHERE username='%s' AND password=MD5('%s') LIMIT 1