08.10.2011, 11:35
I'm loading my vehicles from my MySQL database, however, I'm allowing for players to delete their vehicles in-game and thus obviously a 'DELETE FROM' is called. This causes the id's of the cars on the DB to break out of order (Example: 213, 215, 216)
When the function is called to load the data it gets to the car ID which doesn't exist and creates X amount of cars from the last vehicle loaded. X is equal to the range of missing id's. How do I make it so the loop detects 0 rows returned for the 'SELECT * FROM vehicles WHERE id = X' and stops the load of data for that car, but still continues?
Thanks.
When the function is called to load the data it gets to the car ID which doesn't exist and creates X amount of cars from the last vehicle loaded. X is equal to the range of missing id's. How do I make it so the loop detects 0 rows returned for the 'SELECT * FROM vehicles WHERE id = X' and stops the load of data for that car, but still continues?
Thanks.