Hello all,
I’am inserting data into a table using the MySQL Async lua library. The problem I have is that I insert data into my database using the following code:
for i=1, #checkpoints, 1 do
MySQL.Async.insert('INSERT INTO RaceCheckpoints (RaceID, CheckpointX, CheckpointY, CheckpointZ) VALUES (@RaceID, @X, @Y, @Z)',
{ ['@RaceID'] = insertId, ['@X'] = checkpoints[i].coords.x, ['@Y'] = checkpoints[i].coords.y, ['@Z'] = checkpoints[i].coords.z})
end
I expected the queries performed in the loop to be executed in order. However in practice the insert of iteration 3 could be done before the query of iteration 2. I’am however expecting the order to be right once I reload the data. Is there a way to force the queries to be performed in the order of the iteration?
Thanks in advance.