Mysql login error Strickenkid's - 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 login error Strickenkid's (
/showthread.php?tid=378075)
Mysql login error Strickenkid's -
ViPGuy - 16.09.2012
Hey!
Heres the code:
Код:
CheckAccountExists(account[])
{
new string[128];
format(string, sizeof(string), "SELECT * FROM users WHERE username = '%s'", account);
mysql_query(string,1);
mysql_store_result(Handle);
new value;
value = mysql_num_rows(Handle);
mysql_free_result(Handle);
return value;
}
The console says that the query is executed but it gives me sum errors when i try to store the value..
Код:
[Sun Sep 16 15:07:34 2012] Error (0): Function: mysql_store_result called when no prior successful query executed.
[Sun Sep 16 15:07:34 2012] Error (0): Function: mysql_num_rows called when no result stored.
I have the connection..
Thank you!
Re: Mysql login error Strickenkid's -
scottyishere - 16.09.2012
Does the table USERS exist? Does the variable USERNAME in table USERS exist?
pawn Код:
CheckAccountExists(account[])
{
new string[128];
format(string, sizeof(string), "SELECT * FROM `users` WHERE `username`= '%s'", account);
new q = mysql_query(string);
if(!q) return printf("Query did not work. %d",mysql_errno());
mysql_store_result();
new value;
value = mysql_num_rows(Handle);
mysql_free_result(Handle);
return value;
}
Try this. Check console and tell me if any error popped up.