SA-MP Forums Archive
Please help me (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: Please help me (mysql) (/showthread.php?tid=570529)



Please help me (mysql) - ilepopivanov - 11.04.2015

When i press F5 I get this error

pawn Код:
error 017: undefined symbol "cache_get_field_content_string"
The line is:
pawn Код:
PlayerInfo[playerid][pEmail] = cache_get_field_content_string(0, " ");//



Re: Please help me (mysql) - JaKe Elite - 11.04.2015

What MySQL version do you have? I believe that function native is only available on the Threaded Version of MySQL which is R7.


Re: Please help me (mysql) - ilepopivanov - 11.04.2015

https://github.com/pBlueG/SA-MP-MySQL/releases http://prntscr.com/6sf36p


AW: Please help me (mysql) - Mencent - 11.04.2015

Hello!

You have to write it so:
PHP код:
cache_get_field_content(0,"pEmail",PlayerInfo[playerid][pEmail],connectionhandle,30);
// 0 = row
// pEmail = name
// PlayerInfo[playerid][pEmail] = your enum variable
// connectionhandle = The Connection handle (MySQL)
// 30 = length of pEmail 
Mencent


Re: Please help me (mysql) - Konstantinos - 11.04.2015

https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content

Modify it according to the names/lenght you're using.


Re: AW: Please help me (mysql) - ilepopivanov - 11.04.2015

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

You have to write it so:
PHP код:
cache_get_field_content(0,"pEmail",PlayerInfo[playerid][pEmail],connectionhandle,30);
// 0 = row
// pEmail = name
// PlayerInfo[playerid][pEmail] = your enum variable
// connectionhandle = The Connection handle (MySQL)
// 30 = length of pEmail 
Mencent
Thanks I fixed this. in my mysql_log onplayerdissconnect i found this

Код:
[16:01:18] [DEBUG] mysql_format - connection: 1, len: 1000, format: "UPDATE `players` SET `Pari`=%d, `Admin`=%d, `Spawn`=%d, `Pol`=%d, `Drzava`=%d, `Godini`=%d, `Email`=%s, `Skin`=%d, `GM`=%d, `Lev..."
[16:01:18] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `Pari`=10000, `Admin`=0, `Spawn`=0, `Pol`=0", callback: "(null)", format: "(null)"
[16:01:18] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[16:01:18] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `Skin`=7, `GM`=0, `Level`=0, `Exp`=0, `Rep`=0, `Kukja`=0, `Rent`=0, `Stan`=0, `' at line 1
[16:01:18] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError



Re: Please help me (mysql) - Konstantinos - 11.04.2015

Whenever you pass a string in mysql_format, use ' ' around %s and %e. Also it's recommended to use %e instead to escape the string directly.

Change:
pawn Код:
... `Email`=%s ...
to:
pawn Код:
... `Email`='%e' ...