14.11.2010, 20:15
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:
So if you could tell me whats wrong with this query that would really help
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
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;
}