Don't understand what's wrong with this mysql query.
#1

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.
Reply
#2

check mysql_log.txt, maybe there's an error / a warning
Reply
#3

I'll have to run the debug.
Reply
#4

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.
Reply
#5

Thanks a lot, I've resolved this!
Reply
#6

always a pleasure
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)