SA-MP Forums Archive
Problem MYSQL Log - 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 MYSQL Log (/showthread.php?tid=528074)



Problem MYSQL Log - Cam972 - 26.07.2014

Hi,
I have some problem with my UPDATE car system.
I Have a MYSQL error in the mysql log and i don't find the error in the pawn code

Please helps me :/


------------------------- MYSQL LOG ERROR-------------------------------
[05:09:15] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `cars` SET `cLocation`=0, `cFaction`=0, `cModel`=415, `cL", callback: "(null)", format: "(null)"
[05:09:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[05:09:15] [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 'Cheetah', `cValue`=2000, `cLicense`='LA - 1', `cRegistration`=0, `cOwned`=1, `cL' at line 1

------------------------PAWNO------------------------
http://pastebin.com/LfwzBBs5


Re: Problem MYSQL Log - d3ll - 26.07.2014

Use mysql_format, instead of format.

pawn Код:
new string[200],query[1500];

mysql_format(mysql, string, sizeof(string),"UPDATE `cars` SET `cLocation` = %d, `cFaction` = %d, `cModel` = %d, `cLocationx` = %f, `cLocationy` = %f, `cLocationz` = %f, `cAngle` = %f, `cColorOne` = %d, `cColorTwo` = %d, `cOwner` = '%s', ", CarInfo[v][cLocation], CarInfo[v][cFaction], CarInfo[v][cModel], CarInfo[v][cLocationx], CarInfo[v][cLocationy], CarInfo[v][cLocationz], CarInfo[v][cAngle], CarInfo[v][cColorOne],CarInfo[v][cColorTwo], CarInfo[v][cOwner]);
strcat(query, string);

mysql_format(mysql, string, sizeof(string),"`cDescription` = '%s', `cValue` = %d, `cLicense` = '%s', `cRegistration` = %d, `cOwned`=%d, `cLock`=%d, `mod1`=%d, `mod2`=%d, `mod3`=%d, `mod4`=%d, `mod5`=%d, `mod6`=%d, ",CarInfo[v][cDescription],CarInfo[v][cValue],CarInfo[v][cLicense],CarInfo[v][cRegistration],CarInfo[v][cOwned],CarInfo[v][cLock],CarInfo[v][mod1],CarInfo[v][mod2],CarInfo[v][mod3],CarInfo[v][mod4],CarInfo[v][mod5], CarInfo[v][mod6]);
strcat(query, string);

mysql_format(mysql, string, sizeof(string),"`mod7`=%d, `mod8`=%d, `mod9`=%d, `mod10`=%d, `mod11`=%d, `mod12`=%d, `mod13`=%d, `mod14`=%d, `mod15`=%d, `mod16`=%d, `mod17`=%d, ",CarInfo[v][mod7],CarInfo[v][mod8],CarInfo[v][mod9],CarInfo[v][mod10],CarInfo[v][mod11], CarInfo[v][mod12],CarInfo[v][mod13],CarInfo[v][mod14],CarInfo[v][mod15],CarInfo[v][mod16], CarInfo[v][mod17]);
strcat(query, string);

mysql_format(mysql, string, sizeof(string),"`paintjob`=%d, `tNeon`=%d, `CT`=%d, `Assurance`=%d WHERE `ID`=%d", CarInfo[v][paintjob],CarInfo[v][tNeon],CarInfo[v][CT],CarInfo[v][Assurance], CarInfo[v][cID]);
strcat(query, string);

mysql_tquery(mysql, query);



Re: Problem MYSQL Log - Cam972 - 26.07.2014

Edit :/


Re: Problem MYSQL Log - Cam972 - 26.07.2014

thanks i try it


Re: Problem MYSQL Log - Cam972 - 26.07.2014

[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 'cDescription` = 'Cheetah', `cValue` = 2000, `cLicense` = 'LA - 1', `cRegistratio' at line 1

MYSQL Error again :/


Re: Problem MYSQL Log - Cam972 - 26.07.2014

up :/