MySQL Errors - 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 Errors (
/showthread.php?tid=662381)
MySQL Errors -
BlackyX - 30.12.2018
Any advice on fixing these mysql errors?
https://pastebin.com/WkcDctxW
Re: MySQL Errors -
Dayrion - 30.12.2018
Logs say everything you need to know, read them carefully. Like:
Код:
[07:41:49] WARNING [SQLError]: errorid: 1064, error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`lastCarID` = 0, `maxcarslots` = 3, `Mapper`= 0,`customTag`= '',`customRank`= ''' at line 1
Re: MySQL Errors -
BlackyX - 30.12.2018
Quote:
Originally Posted by Dayrion
Logs say everything you need to know, read them carefully. Like:
Код:
[07:41:49] WARNING [SQLError]: errorid: 1064, error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`lastCarID` = 0, `maxcarslots` = 3, `Mapper`= 0,`customTag`= '',`customRank`= ''' at line 1
|
I still don't get it. What's the issue about the syntax on these fields and what's a possible way to fix them?
Re: MySQL Errors -
Chyakka - 30.12.2018
You're using one too many apostrophes in your query, could you post the query that's performing the save?
Re: MySQL Errors -
BlackyX - 30.12.2018
Quote:
Originally Posted by Chyakka
You're using one too many apostrophes in your query, could you post the query that's performing the save?
|
Код:
mysql_format(sqlGameConnection, query, sizeof(query), "%s `lastCarID` = %d, `maxcarslots` = %d, `Mapper`= %d,`customTag`= '%e',`customRank`= '%e',`LastLogin`= '%e',`PropDate`= '%e',`isinHosp`= %d,`HasMap`= %d,`JailNumber`= %d,`NewCarLic`= %d,`NewBoatLic`= %d,`NewGunLic`= %d,`SueUnix`= %d,",
query, PlayerInfo[playerid][lastCarID], PlayerInfo[playerid][pMaxCarSlots], PlayerInfo[playerid][pMapper], CustomTag[playerid], customRank[playerid], PlayerInfo[playerid][pLastLogin], PlayerInfo[playerid][pPropExp], pInHospital[playerid], PlayerInfo[playerid][pMap], PlayerInfo[playerid][pJailnumber], PlayerInfo[playerid][pCarLicense], PlayerInfo[playerid][pBoatLicense], PlayerInfo[playerid][pWeaponLicense], PlayerInfo[playerid][pSueUnix]);
I believe this is it
Re: MySQL Errors -
TheToretto - 30.12.2018
Where's the action to be performed? I can see a string called query but it makes no sense. I believe you want to put an UPDATE query. Check its usage if you don't know how to use it.
Re: MySQL Errors -
BlackyX - 30.12.2018
Quote:
Originally Posted by TheToretto
Where's the action to be performed? I can see a string called query but it makes no sense. I believe you want to put an UPDATE query. Check its usage if you don't know how to use it.
|
it's a long one and the beginning is far behind from the ones that have errors.
I believe it's UPDATE `players` SET .... for all of them
https://i.imgur.com/gQ9wJGg.png
Re: MySQL Errors -
Calisthenics - 30.12.2018
Add the missing comma before `lastCarID`
Re: MySQL Errors -
Mobtiesgangsa - 31.12.2018
here is my example:
Код:
"UPDATE `Players` SET `Admin` = '%d', `Money` = '%d', `Kills` = '%d', ... and so on, and so on, WHERE `ID` = '%d' "
``
''
,
;
Re: MySQL Errors -
BlackyX - 31.12.2018
Quote:
Originally Posted by Mobtiesgangsa
here is my example:
Код:
"UPDATE `Players` SET `Admin` = '%d', `Money` = '%d', `Kills` = '%d', ... and so on, and so on, WHERE `ID` = '%d' "
``
''
,
;
|
so all of them must be
`Money
`=
'%d
'?
I see all of them are done without the ' ' on %d but only on %e and they don't have a problem, my wonder is why it makes a problem here.