SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/12/2018, 02:23 PM   #1
BlackyX
Little Clucker
 
BlackyX's Avatar
 
Join Date: Dec 2018
Posts: 28
Reputation: 4
Question MySQL Errors

Any advice on fixing these mysql errors?
https://pastebin.com/WkcDctxW
BlackyX is offline   Reply With Quote
Old 30/12/2018, 03:12 PM   #2
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,918
Reputation: 258
Default Re: MySQL Errors

Logs say everything you need to know, read them carefully. Like:
Code:
[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
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 30/12/2018, 04:43 PM   #3
BlackyX
Little Clucker
 
BlackyX's Avatar
 
Join Date: Dec 2018
Posts: 28
Reputation: 4
Default Re: MySQL Errors

Quote:
Originally Posted by Dayrion View Post
Logs say everything you need to know, read them carefully. Like:
Code:
[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?
BlackyX is offline   Reply With Quote
Old 30/12/2018, 07:31 PM   #4
Chyakka
Big Clucker
 
Join Date: Jul 2015
Location: England
Posts: 60
Reputation: 10
Default Re: MySQL Errors

Code:
`customRank`= '''
You're using one too many apostrophes in your query, could you post the query that's performing the save?
Chyakka is offline   Reply With Quote
Old 30/12/2018, 08:37 PM   #5
BlackyX
Little Clucker
 
BlackyX's Avatar
 
Join Date: Dec 2018
Posts: 28
Reputation: 4
Default Re: MySQL Errors

Quote:
Originally Posted by Chyakka View Post
Code:
`customRank`= '''
You're using one too many apostrophes in your query, could you post the query that's performing the save?
Code:
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
BlackyX is offline   Reply With Quote
Old 30/12/2018, 08:45 PM   #6
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 585
Reputation: 66
Default Re: MySQL Errors



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.
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 30/12/2018, 09:58 PM   #7
BlackyX
Little Clucker
 
BlackyX's Avatar
 
Join Date: Dec 2018
Posts: 28
Reputation: 4
Default Re: MySQL Errors

Quote:
Originally Posted by TheToretto View Post


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
BlackyX is offline   Reply With Quote
Old 30/12/2018, 10:22 PM   #8
Calisthenics
High-roller
 
Join Date: May 2018
Posts: 1,096
Reputation: 175
Default Re: MySQL Errors

Add the missing comma before `lastCarID`
Calisthenics is offline   Reply With Quote
Old 31/12/2018, 03:12 AM   #9
Mobtiesgangsa
Big Clucker
 
Mobtiesgangsa's Avatar
 
Join Date: Oct 2016
Location: The Strip
Posts: 154
Reputation: 16
Default Re: MySQL Errors

here is my example:

Code:
"UPDATE `Players` SET `Admin` = '%d', `Money` = '%d', `Kills` = '%d', ... and so on, and so on, WHERE `ID` = '%d' "

``

''
,
;
__________________
WARNING IM NOT HERE
Mobtiesgangsa is offline   Reply With Quote
Old 31/12/2018, 09:33 AM   #10
BlackyX
Little Clucker
 
BlackyX's Avatar
 
Join Date: Dec 2018
Posts: 28
Reputation: 4
Default Re: MySQL Errors

Quote:
Originally Posted by Mobtiesgangsa View Post
here is my example:

Code:
"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.
BlackyX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySql errors MarkoKraljina Scripting Help 1 09/10/2018 03:41 PM
mysql.inc errors Ben_Hatfield Scripting Help 3 02/12/2012 06:21 AM
Keep getting MYSQL errors.. Jstylezzz Scripting Help 2 18/04/2012 05:02 PM
Need help with some MySQL errors johannetje2 Help Archive 2 16/04/2011 09:46 PM


All times are GMT. The time now is 07:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.