Posts: 1,648
Threads: 482
Joined: Jun 2010
pawn Код:
new query[550];
format(query, sizeof(query), "UPDATE `vehicles` SET VehFType = %d, VehSpark = %d, VehBrake = %d, VehGear = %d, VehElec = %d, VehWater = %d, VehOil = %d, VehExhaust = %d, VehFLine = %d, VehRadi = %d, VehFSize = %d, VehFUsed = %d, VehBattery = %d WHERE id = %d LIMIT 1" ,VehFType[vehicleid], VehSpark[vehicleid], VehBrake[vehicleid], VehGear[vehicleid], VehElec[vehicleid],
VehWater[vehicleid], VehOil[vehicleid], VehExhaust[vehicleid], VehRadi[vehicleid], VehFLine[vehicleid], VehFSize[vehicleid], VehFUsed[vehicleid], VehBattery[vehicleid], VehFSize[vehicleid], VehicleSQLID[vehicleid]);
mysql_query(query);
Title says all, it just doesn't update anything or return anything in the console.
Posts: 511
Threads: 13
Joined: Jun 2012
Reputation:
0
check mysql_log.txt, maybe there's an error / a warning
Posts: 1,648
Threads: 482
Joined: Jun 2010
I'll have to run the debug.
Posts: 138
Threads: 1
Joined: Jul 2007
Reputation:
0
for starters remove LIMIT 1, there should already be only 1 record since your selecting it by id, which should be unique.
Secondly VehRadi[vehicleid] & VehFLine[vehicleid] need to swap places in the list of arguments to match the field/colum-names of the query
Finally VehFSize[vehicleid] is featured twice in the list of arguments, in effect setting the 'double' of the id at the end of the query too VehFSize[vehicleid], totally screwing over the query, and you actually have 1 argument more then you have placeholders (the %d stuff) so remove the VehFSize[vehicleid] after VehBattery[vehicleid] to resolve.
Posts: 1,648
Threads: 482
Joined: Jun 2010
Thanks a lot, I've resolved this!