SA-MP Forums Archive
MYSQL Issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL Issue (/showthread.php?tid=482510)



MYSQL Issue - UnknownGamer - 21.12.2013

pawn Код:
[15:55:17] [DEBUG] mysql_format - connection: 1, len: 548, format: "INSERT INTO vehicles VALUES (%d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, '%e', %d, %d, %d, %d, '%e') ON DUPLICATE KEY UPDATE    id ..."
[15:55:17] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO vehicles VALUES (0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0,", callback: "FJ37DH3JG_MYSQL_INTERNAL", format: "d"
[15:55:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:55:17] [DEBUG] CMySQLQuery::Create - inline function detected
[15:55:17] [DEBUG] mysql_tquery - scheduling query "INSERT INTO vehicles VALUES (0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, '', 0, 0, 0, 0, '') ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), model = VALUES(model), locX = VALUES(locX), locY = VALUES(locY), locZ = VALUES(locZ), angle = VALUES(angle), color1 = VALUES(color1), color2 = VALUES(color2), ownerId = VALUES(ownerId), owner = VALUES(owner),locked = VALUES(locked), paintjob = VALUES(paintjob), virtualworld = VALUES(virtualworld), code = VALUES(code), plate = VALUES(plate)"..
[15:55:17] [DEBUG] mysql_format - connection: 1, len: 548, format: "INSERT INTO vehicles VALUES (%d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, '%e', %d, %d, %d, %d, '%e') ON DUPLICATE KEY UPDATE    id ..."
[15:55:17] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO vehicles VALUES (0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0,", callback: "FJ37DH3JG_MYSQL_INTERNAL", format: "d"
[15:55:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:55:17] [DEBUG] CMySQLQuery::Create - inline function detected
[15:55:17] [DEBUG] mysql_tquery - scheduling query "INSERT INTO vehicles VALUES (0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, '', 0, 0, 0, 0, '') ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), model = VALUES(model), locX = VALUES(locX), locY = VALUES(locY), locZ = VALUES(locZ), angle = VALUES(angle), color1 = VALUES(color1), color2 = VALUES(color2), ownerId = VALUES(ownerId), owner = VALUES(owner),locked = VALUES(locked), paintjob = VALUES(paintjob), virtualworld = VALUES(virtualworld), code = VALUES(code), plate = VALUES(plate)"..
[15:55:17] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL(d)] - starting query execution
[15:55:17] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL(d)] - query was successful
[15:55:17] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[15:55:17] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL(d)] - data being passed to ProcessCallbacks()
[15:55:17] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL(d)] - starting query execution
[15:55:17] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL(d)] - query was successful
[15:55:17] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[15:55:17] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL(d)] - data being passed to ProcessCallbacks()
[15:55:17] [DEBUG] Calling callback "FJ37DH3JG_MYSQL_INTERNAL"..
[15:55:17] [DEBUG] cache_insert_id - connection: 1
[15:55:17] [DEBUG] mysql_tquery - connection: 1, query: "START TRANSACTION", callback: "(null)", format: "(null)"
[15:55:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:55:17] [DEBUG] mysql_tquery - scheduling query "START TRANSACTION"..
[15:55:17] [DEBUG] mysql_format - connection: 1, len: 548, format: "INSERT INTO vehicle_components SET slotId = %d, vehicleId = %d, value = %d ON DUPLICATE KEY UPDATE value = VALUES(value)"
[15:55:17] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO vehicle_components SET slotId = 0, vehicleId = 3, va", callback: "(null)", format: "(null)"
[15:55:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:55:17] [DEBUG] mysql_tquery - scheduling query "INSERT INTO vehicle_components SET slotId = 0, vehicleId = 3, value = 0 ON DUPLICATE KEY UPDATE value = VALUES(value)"..
[15:55:17] [DEBUG] mysql_format - connection: 1, len: 548, format: "INSERT INTO vehicle_components SET slotId = %d, vehicleId = %d, value = %d ON DUPLICATE KEY UPDATE value = VALUES(value)"
[15:55:17] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO vehicle_components SET slotId = 1, vehicleId = 3, va", callback: "(null)", format: "(null)"
[15:55:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:55:17] [DEBUG] mysql_tquery - scheduling query "INSERT INTO vehicle_components SET slotId = 1, vehicleId = 3, value = 0 ON DUPLICATE KEY UPDATE value = VALUES(value)"..
[15:55:17] [DEBUG] mysql_format - connection: 1, len: 548, format: "INSERT INTO vehicle_components SET slotId = %d, vehicleId = %d, value = %d ON DUPLICATE KEY UPDATE value = VALUES(value)"
[15:55:17] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO vehicle_components SET slotId = 2, vehicleId = 3, va", callback: "(null)", format: "(null)"
[15:55:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:55:17] [DEBUG] mysql_tquery - scheduling query "INSERT INTO vehicle_components SET slotId = 2, vehicleId = 3, value = 0 ON DUPLICATE KEY UPDATE value = VALUES(value)"..
[15:55:17] [DEBUG] mysql_format - connection: 1, len: 548, format: "INSERT INTO vehicle_components SET slotId = %d, vehicleId = %d, value = %d ON DUPLICATE KEY UPDATE value = VALUES(value)"
pawn Код:
mysql_format(dbhandle, query, sizeof query, "INSERT INTO vehicles VALUES (%d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, '%e', %d, %d, %d, %d, '%e') \
        ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), model = VALUES(model), "
,
        CarInfo[idx][cdbID], CarInfo[idx][cModel], CarInfo[idx][cLocationx],    CarInfo[idx][cLocationy],
        CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo],
        0, CarInfo[idx][cOwner], CarInfo[idx][cLock], CarInfo[idx][cPaintjob], CarInfo[idx][cVirWorld], CarInfo[idx][cCode], CarInfo[idx][cPlate]);

        strcat(query, "locX = VALUES(locX), \
        locY = VALUES(locY), locZ = VALUES(locZ), angle = VALUES(angle), \
        color1 = VALUES(color1), color2 = VALUES(color2), ownerId = VALUES(ownerId), \
        owner = VALUES(owner),\
        locked = VALUES(locked), paintjob = VALUES(paintjob), \
        virtualworld = VALUES(virtualworld), code = VALUES(code), plate = VALUES(plate)"
);

        mysql_tquery_inline(dbhandle, query, using CarHandler, "");
Can someone fix that query?

The DB vehicles are duplicating as '0', values. When someone logs in... that shouldn't happen.