What is wrong with this query?
#1

Hello,

Im trying to move my privatecars script onto MySQL,
So first of all i made a command which will save them all onto MySQL,
So i went ingame and did "/mysql_save" and then went on MySQL,
And well the vehicle was on there but the X, Y, Z, Angle, Model was 0
Then i looked at the console and i got:

Код:
[21:21:55] Error in mysql_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 '' at line 1
So if you could tell me whats wrong with this query that would really help

pawn Код:
CMD:mysql_save(playerid, params[])
{
    new Float:x, Float:y, Float:z, Float:a;
    new vehicleid = GetPlayerVehicleID(playerid);

    GetVehicleZAngle(vehicleid, a);
    GetVehiclePos(vehicleid, x, y, z);
   
    format(query, sizeof(query), "INSERT INTO `vehicles` (VehID, VehOwner) VALUES ('%d', '%s')", GetPlayerVehicleID(playerid), GetName(playerid));
    samp_mysql_query(query);
   
    format(query, sizeof(query), "UPDATE `vehicles` SET `VehModel` = %d, `VehX` = %f, `VehY` = %f, `VehZ` = %f, `VehA` = %f WHERE `VehID` = '%d'", GetVehicleModel(vehicleid), x, y, z, a, GetPlayerVehicleID(playerid));
    samp_mysql_query(query);
    return 1;
}
Reply


Messages In This Thread
What is wrong with this query? - by iTorran - 14.11.2010, 20:15
Re: What is wrong with this query? - by smeti - 14.11.2010, 20:30
Re: What is wrong with this query? - by iTorran - 14.11.2010, 20:34
Re: What is wrong with this query? - by smeti - 14.11.2010, 20:38
Re: What is wrong with this query? - by iTorran - 14.11.2010, 21:13
Re: What is wrong with this query? - by Fezq - 14.11.2010, 21:43

Forum Jump:


Users browsing this thread: 3 Guest(s)