Error querys
#1

I have this errors with querys:
PHP код:
[19:40:05] [ERRORCMySQLQuery::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 ' `HouseOwner`=0, `HouseOwner2`=0, `HouseOwner3`=0 WHERE `ID`=0' at line 1
[19:40:05] [ERRORCMySQLQuery::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 ' `BizOwner`=0, `PermisAuto`=0, `Gun1`=0 WHERE `ID`=0' at line 1
[19:40:05] [ERRORCMySQLQuery::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 ' `JailReason`=, `Kills`=, `Deaths`=0, `FactionID`=0 WHERE `ID`=0' at line 1 
What is the problem please ?
Reply
#2

first:
PHP код:
    mysql_format(mysqlquerysizeof(query), "UPDATE `joueurs` SET `RankJob`=%d, `Suspect`=%d, `SuspectRaison`=%s, `HouseOwner`=%d, `HouseOwner2`=%d, `HouseOwner3`=%d WHERE `ID`=%d"pInfo[playerid][RankJob], pInfo[playerid][Suspect], pInfo[playerid][SuspectRaison], pInfo[playerid][HouseOwner], pInfo[playerid][HouseOwner2], pInfo[playerid][HouseOwner3], pInfo[playerid][ID]);
    
mysql_tquery(mysqlquery""""); 
2nd
PHP код:
    mysql_format(mysqlquerysizeof(query), "UPDATE `joueurs` SET `CarOwner`=%d, `CarOwner2`=%d, `CarOwner3`=%s, `BizOwner`=%d, `PermisAuto`=%d, `Gun1`=%d WHERE `ID`=%d"pInfo[playerid][CarOwner], pInfo[playerid][CarOwner2], pInfo[playerid][CarOwner3], pInfo[playerid][BizOwner], pInfo[playerid][PermisAuto], pInfo[playerid][Gun1], pInfo[playerid][ID]);
    
mysql_tquery(mysqlquery""""); 
3rd
PHP код:
    mysql_format(mysqlquerysizeof(query), "UPDATE `joueurs` SET `JailAdmin`=%s, `JailRaison`=%s, `Kills`=%s, `Deaths`=%d, `FactionID`=%d WHERE `ID`=%d"pInfo[playerid][JailAdmin], pInfo[playerid][JailRaison], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][FactionID], pInfo[playerid][ID]);
    
mysql_tquery(mysqlquery""""); 
Reply
#3

up, need help
Reply
#4

Troubleshoot the SQL syntax...

go into your phpmyadmin and run the SQL code with some dummy data... Just to make sure the sql is correct..

Then using printf() or something... test out the the variables you are putting into the SQL query to make sure they are all correctly set...
Reply
#5

PhpMyAdmin will help u better but... check the table's name and column's names

On 3rd code kills=%s, maybe %d?

try with

PHP код:
mysql_format(mysqlquerysizeof(query), "UPDATE `joueurs` SET `JailAdmin`='%s', `JailRaison`='%s', `Kills`=%d, `Deaths`=%d, `FactionID`=%d WHERE `ID`=%d"pInfo[playerid][JailAdmin], pInfo[playerid][JailRaison], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][FactionID], pInfo[playerid][ID]);
    
mysql_tquery(mysqlquery""""); 
Reply
#6

change
`SuspectRaison`=%s
`CarOwner3`=%s
`JailAdmin`=%s
`JailRaison`=%s
`Kills`=%s
to
Код:
`SuspectRaison`='%s'
Код:
`CarOwner3`='%s'
Код:
`JailAdmin`='%s'
Код:
`JailRaison`='%s'
Код:
`Kills`='%s'
Don't forget single quote for string
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)