16.06.2010, 17:22
Hey, 30 minutes so far, i've been staring at this query and figuring out what's wrong with it. It used to work, now it just randomly stopped.
What I know
- The problem doesn't involve the size of the string.
- The query in the MySQL log returns: [code=MySQL Log]CMySQLHandler::Query(UPDATE Vehicles SET Model=0, X='0.000000',Y='0.000000',Z='0.000000',Angle='0.00 0000',Color1=0,Color2=0,Mod1=0,Mod2=0,Mod3=0,Mod4= 0,Mod5=0,Mod6=0,Mod7=0,Mod8=0,Mod9=0,Mod10=0,Mod11 =0,Mod12=0,Mod13=0,Range='0.000000',Health='0.0000 00',Owner='None',Type=0,RentPrice=0,Price=0,Fuel=0 ,Faction=0,Job=0,Buyable=0,Locked=0,Rentable=0, ParkX='0.000000',ParkY='0.000000',ParkZ='0.000000' ,ParkAngle='0.000000',fCarID=0 WHERE vehicleid = 3) - An error has occured. (Error ID: 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 'Range='0.000000',Health='0.000000',Owner='None',T ype=0,RentPrice=0,Price=0,Fuel=' at line 1)[/code]
Anyway, the function with the query is below, maybe my eyes are messed up or i'm not reading carefully or working carefully.
What I know
- The problem doesn't involve the size of the string.
- The query in the MySQL log returns: [code=MySQL Log]CMySQLHandler::Query(UPDATE Vehicles SET Model=0, X='0.000000',Y='0.000000',Z='0.000000',Angle='0.00 0000',Color1=0,Color2=0,Mod1=0,Mod2=0,Mod3=0,Mod4= 0,Mod5=0,Mod6=0,Mod7=0,Mod8=0,Mod9=0,Mod10=0,Mod11 =0,Mod12=0,Mod13=0,Range='0.000000',Health='0.0000 00',Owner='None',Type=0,RentPrice=0,Price=0,Fuel=0 ,Faction=0,Job=0,Buyable=0,Locked=0,Rentable=0, ParkX='0.000000',ParkY='0.000000',ParkZ='0.000000' ,ParkAngle='0.000000',fCarID=0 WHERE vehicleid = 3) - An error has occured. (Error ID: 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 'Range='0.000000',Health='0.000000',Owner='None',T ype=0,RentPrice=0,Price=0,Fuel=' at line 1)[/code]
Anyway, the function with the query is below, maybe my eyes are messed up or i'm not reading carefully or working carefully.
pawn Код:
function SaveVehicle(vehicleid) {
new string[620];
format(string, sizeof(string), "UPDATE Vehicles SET Model=%d, X='%f',Y='%f',Z='%f',Angle='%f',Color1=%d,Color2=%d,Mod1=%d,Mod2=%d,Mod3=%d,Mod4=%d,Mod5=%d,Mod6=%d,Mod7=%d,Mod8=%d,Mod9=%d,Mod10=%d,Mod11=%d,Mod12=%d,Mod13=%d,Range='%f',Health='%f',Owner='%s',Type=%d,RentPrice=%d,Price=%d,Fuel=%d,Faction=%d,Job=%d,Buyable=%d,Locked=%d,Rentable=%d, ParkX='%f',ParkY='%f',ParkZ='%f',ParkAngle='%f',fCarID=%d WHERE vehicleid = %d",
CarData[vehicleid][vModel],CarData[vehicleid][VPos][0],CarData[vehicleid][VPos][1],CarData[vehicleid][VPos][2],CarData[vehicleid][VPos][3],
CarData[vehicleid][vColors][0],CarData[vehicleid][vColors][1],CarData[vehicleid][Vmod][0],CarData[vehicleid][Vmod][1],CarData[vehicleid][Vmod][2],CarData[vehicleid][Vmod][3],
CarData[vehicleid][Vmod][4],CarData[vehicleid][Vmod][5],CarData[vehicleid][Vmod][6],CarData[vehicleid][Vmod][7],CarData[vehicleid][Vmod][8],
CarData[vehicleid][Vmod][9],CarData[vehicleid][Vmod][10],CarData[vehicleid][Vmod][11],CarData[vehicleid][Vmod][12], CarData[vehicleid][Range],
CarData[vehicleid][vHealth],CarData[vehicleid][Owner],CarData[vehicleid][Type],CarData[vehicleid][RentPrice],CarData[vehicleid][Price],
GetVehicleFuel(vehicleid),CarData[vehicleid][Faction],CarData[vehicleid][Job],CarData[vehicleid][Buyable],CarData[vehicleid][Locked],
CarData[vehicleid][Rentable],CarData[vehicleid][ParkPos][0],CarData[vehicleid][ParkPos][1],CarData[vehicleid][ParkPos][2],CarData[vehicleid][ParkPos][3],CarData[vehicleid][FCarID], vehicleid);
mysql_query(string);
}