Problem with MySQL - 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: Problem with MySQL (
/showthread.php?tid=480601)
[SOLVED]Problem with MySQL -
AA9 - 11.12.2013
I have a little problem, with MySQL. It should check, is there any row, with that player name. But when i checked debug, there was a error message. I have tried a couple of hours, to fix this, but no result.
pawn Код:
CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
pawn Код:
format(query, sizeof(query), "SELECT status FROM `playerdata` WHERE user = '%s' LIMIT 1", pname);
mysql_query(query);
mysql_store_result();
mysql_fetch_row(staatus);
mysql_free_result();
mysql_store_result();
new rows = mysql_num_rows();
if(rows == 1)
{
if(strval(staatus) != 3) return KickWithMessage(playerid, V_PUNANE, "Test");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logi Sisse","Kasutaja eksisteerib andmebaasis. Logimiseks sisesta oma {0000FF}parool{FFFFFF} alla lahtrisse!","Logi Sisse","Katkesta"); //Shows our login dialog :).
}
mysql_free_result();
return 1;
}
Re: Problem with MySQL -
Danyal - 11.12.2013
you are not connected to you MYSQL data base try to ping mysql server and see what it returns...
Re: Problem with MySQL -
AA9 - 12.12.2013
No, it is connected. When i loaded gamemode, it loaded all houses/businesses/cars/factions successfully, so problem is somewhere else.
Re: Problem with MySQL -
AA9 - 12.12.2013
Anyone?
Re: Problem with MySQL -
AA9 - 12.12.2013
I FIXED IT! It said that, beacause it didnt have something, to controll, is there any rows. I first mysql_free_result & second mysql_store_result();
Re: Problem with MySQL -
fevelix - 15.12.2013
If there is a problem with the database open "DeBug.txt" to see that the script does not like