new Query[128];
format(Query, sizeof(Query), "INSERT INTO vehicles (Model,ParkX,ParkY,ParkZ,ParkA,Color1,Color2,VehicleOwner,VehicleDescription,Owned,Locked,LockBought,RentPrice,Alarm,VehKey,PaintJob,Insurance,Scratches) VALUES ('%d','%f,'%f','%f','%f','%d','%d','%s','%s','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
VehicleInfo[car][vCarId],
VehicleInfo[car][vModel],
VehicleInfo[car][vX],
VehicleInfo[car][vY],
VehicleInfo[car][vZ],
VehicleInfo[car][vAngle],
VehicleInfo[car][vColorOne],
VehicleInfo[car][vColorTwo],
VehicleInfo[car][vOwner],
VehicleInfo[car][vDescription],
VehicleInfo[car][vOwned],
VehicleInfo[car][vLock],
VehicleInfo[car][vLockBuyed],
VehicleInfo[car][vRentPrice],
VehicleInfo[car][vAlarm],
VehicleInfo[car][vKey],
VehicleInfo[car][vPaintJob],
VehicleInfo[car][vInsurances],
VehicleInfo[car][vScratches]);
mysql_query(Query);
printf("%s",Query);
[09/22/10 22:44:54] Error (0): Could not execute 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.
('%d','%f,'%f','%f','%f','%d','%d','%s','%s','%d','%d','%d','%d','%d','%d','%d','%d','%d')
('%d','%f','%f','%f','%f','%d','%d','%s','%s','%d','%d','%d','%d','%d','%d','%d','%d','%d')
[22:53:31] MySQL Error (0): Could not execute 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. [22:53:31] INSERT INTO vehicles (Model,ParkX,ParkY,ParkZ,ParkA,Color1,Color2,VehicleOwner,VehicleDescription,Owned,Locked,LockBought,RentP [22:53:31] Test_User bought a Buffalo.
You're trying to place a string in the Query much bigger than its size, so it's not fully copied in there, hence syntax error
|