Error querys -
streetpeace - 15.03.2015
I have this errors with querys:
PHP код:
[19:40:05] [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 ' `HouseOwner`=0, `HouseOwner2`=0, `HouseOwner3`=0 WHERE `ID`=0' at line 1
[19:40:05] [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 ' `BizOwner`=0, `PermisAuto`=0, `Gun1`=0 WHERE `ID`=0' at line 1
[19:40:05] [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 ' `JailReason`=, `Kills`=, `Deaths`=0, `FactionID`=0 WHERE `ID`=0' at line 1
What is the problem please ?
Re : Error querys -
streetpeace - 15.03.2015
first:
PHP код:
mysql_format(mysql, query, sizeof(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(mysql, query, "", "");
2nd
PHP код:
mysql_format(mysql, query, sizeof(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(mysql, query, "", "");
3rd
PHP код:
mysql_format(mysql, query, sizeof(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(mysql, query, "", "");
Re : Error querys -
streetpeace - 16.03.2015
up, need help
Re: Error querys -
Darrenr - 16.03.2015
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...
Respuesta: Error querys -
Victor_Gutierrez - 16.03.2015
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(mysql, query, sizeof(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(mysql, query, "", "");
Re: Error querys -
X337 - 16.03.2015
change
`SuspectRaison`=%s
`CarOwner3`=%s
`JailAdmin`=%s
`JailRaison`=%s
`Kills`=%s
to
Код:
`SuspectRaison`='%s'
Don't forget single quote for string