SA-MP Forums Archive
MySQL R6 Error - 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 R6 Error (/showthread.php?tid=336854)



MySQL R6 Error - CoaPsyFactor - 23.04.2012

Hello there,

So I have this little error, crashdetect plugin say that mysql_retrieve_row(); has crashed the script, but when we tested that script on windows home host, it worked fine, but when we uploaded to deluxe host, it crash every time when mysql_retrieve_row is called.

pawn Код:
mysql_retrieve_row();
     new banned[1];
     mysql_get_field("banned", banned);
     PlayerInfo[extraid][pBanned] = bool:strval(banned);
Here is part where it crashes. And here is Query

pawn Код:
format(motd, sizeof(motd), "SELECT * FROM `players` WHERE `displayName` = '%s' LIMIT 1", escapedname);
     mysql_query(motd, EXIST_PLAYER_QUERY, playerid);
So if anyone could help us, that would be awesome.

All regards


Re: MySQL R6 Error - CoaPsyFactor - 24.04.2012

Please guys, is it possible that no one got answer for this question :S


Re: MySQL R6 Error - Thomas. - 24.04.2012

Although it may not be directly related to your problem, it's still something you might want to correct.

pawn Код:
new banned[1];
     mysql_get_field("banned", banned);
The field 'banned' in your database table might be of an integer data type, but mysql_get_field still returns a string.
Strings are ended by a NULL terminator. Your array cell size (of the variable 'banned') does not allow the NULL terminator to be added.


Re: MySQL R6 Error - CoaPsyFactor - 24.04.2012

i changed type to varchar(2), and still nothing :/