Query Table - 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: Query Table (
/showthread.php?tid=431359)
Query Table -
cristip - 17.04.2013
Hy,i have this code and my question is why she dont give me result? she tell me that is 0 result in db,but i know as the result are prezent in db.
Код:
new string[128];
GetPlayerName(playerid,username,sizeof(username));
format(string, sizeof(string), "SELECT * FROM users WHERE name = '%s'", username);
mysql_query(string);
mysql_store_result(query);
new rows = mysql_num_rows(result);
Re: Query Table -
Scenario - 17.04.2013
Check your MySQL log file for any error messages.
Re: Query Table -
Vince - 17.04.2013
First: what plugin version are you using? BlueG's plugins R7 and up don't support this style anymore. Second, what happens when you execute this query in another client (phpMyAdmin)?
Re: Query Table -
cristip - 17.04.2013
I have r5, i dont what the problem...
EDIT: I think that here is the problem
Код:
mysql_query(string);
mysql_store_result(query);
new rows = mysql_num_rows(result);