ERROR SQL SYNTAX;
#1

Quote:

[15:45:54] [MySQL] Error (0): Failed to exeute query. 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 'Lock=1 WHERE carid=0' at line 1.

Im getting this error when i try to update the vehicles and im stuck with this now i will put the code what is wrong?

pawn Код:
UpdateVehicle(vehicleid)
{
        new string[256];
        for(new i; i < MAX_VEHICLES; i++)
        {
            format(string, sizeof(string), "UPDATE vehicles SET Model=%d,Color1=%d,Color2=%d,Locationx=%d,Locationy=%d,Locationz=%d,Angle=%d,Owner='%s',Lock=%d WHERE carid=%d",
            vehicleinfo[vehicleid][Model],
            vehicleinfo[vehicleid][Color1],
            vehicleinfo[vehicleid][Color2],
            vehicleinfo[vehicleid][x],
            vehicleinfo[vehicleid][y],
            vehicleinfo[vehicleid][z],
            vehicleinfo[vehicleid][a],
            vehicleinfo[vehicleid][Owner],
            vehicleinfo[vehicleid][Lock],
            vehicleinfo[vehicleid][id]);
            mysql_query(string);
        }
}


EDIT: Im using strickens mysql plugin and i don't want to change xD
Reply
#2

What is wrong with the mysql syntax?
Reply
#3

dont know if thats the problem but x,y and z should be %f because positions are floats
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)