MYSQL error, need help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: MYSQL error, need help (
/showthread.php?tid=586205)
MYSQL error, need help -
AdytzaSS - 20.08.2015
Hello guys, i have a big problem with my server after i move it to mysql r39-2 from r6
I get this error
Код:
[02:00:36] [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 '`0', name = '' WHERE carID = '0'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '1'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '2'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '3'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '4'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '5'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '6'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '7'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '8'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '9'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '10'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '11'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '12'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '13'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '14'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '15'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '16'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '17'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '18'' at line 1
[02:00:36] [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 '`0', name = '' WHERE carID = '19'' at line 1
Is a spam with this error from all the vehicles loaded...
Код:
public IniVehs()
{
new Cache: result5 = mysql_query (handle, "SELECT * FROM `vehicles` ORDER BY `vehicles`.`vehicleID` ASC");
new success = 1;
for ( new i, j = cache_get_row_count ( ); i != j; ++i )
{
new x, stringcar[256];
cache_get_field_content(i, "vehicleID", result); x = strval(result);
if(systemVariables[vehicleCounts][0] + systemVariables[vehicleCounts][1] + systemVariables[vehicleCounts][2] < MAX_VEHICLES)
{
cache_get_field_content(i, "vehicleModelID", result); vehicleVariables[x][vVehicleModelID] = strval(result);
cache_get_field_content(i, "vehiclePosX", result); vehicleVariables[x][vVehiclePosition][0] = floatstr(result);
cache_get_field_content(i, "vehiclePosY", result); vehicleVariables[x][vVehiclePosition][1] = floatstr(result);
cache_get_field_content(i, "vehiclePosZ", result); vehicleVariables[x][vVehiclePosition][2] = floatstr(result);
cache_get_field_content(i, "vehiclePosRotation", result); vehicleVariables[x][vVehicleRotation] = floatstr(result);
cache_get_field_content(i, "vehicleGroup", result); vehicleVariables[x][vVehicleGroup] = strval(result);
cache_get_field_content(i, "vehicleGroupRank", result); vehicleVariables[x][vVehicleGroupRank] = strval(result);
cache_get_field_content(i, "vehicleJob", result); vehicleVariables[x][vVehicleJob] = strval(result);
cache_get_field_content(i, "vehicleCol1", result); vehicleVariables[x][vVehicleColour][0] = strval(result);
cache_get_field_content(i, "vehicleCol2", result); vehicleVariables[x][vVehicleColour][1] = strval(result);
if(vehicleVariables[x][vVehicleColour][0] < 0) {
vehicleVariables[x][vVehicleColour][0] = random(126);
}
if(vehicleVariables[x][vVehicleColour][1] < 0) {
vehicleVariables[x][vVehicleColour][1] = random(126);
}
format(stringcar, 256, "Group %d",vehicleVariables[x][vVehicleGroup]);
vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], 300);
if(vehicleVariables[x][vVehicleGroup] >= 1)
{
SetVehicleNumberPlate(x, stringcar);
}
systemVariables[vehicleCounts][0]++;
}
else
{
success = 0;
printf("ERROR: Vehicle limit reached (MODEL %d, VEHICLEID %d, MAXIMUM %d, TYPE STATIC) [01x08]", vehicleVariables[x][vVehicleModelID], x, MAX_VEHICLES);
}
}
cache_delete(result5);
if(success) printf("[script] %d vehicles loaded.", systemVariables[vehicleCounts][0]);
return 1;
}
Re: MYSQL error, need help -
Simeon87 - 21.08.2015
Do not use '`0`' - Use ' for data-field setting only.