I'm having trouble trying to find the next ID in a mysql table which is set to autoincrement. I would like to retrieve this before the record is created so I can store its ID as a foriegn key with into another table.
I've tried a query
SELECT Max(ID) nextID FROM screenings
But I found this works until I delete the most recently created records because the Max ID is no longer the one previous of the next ID.
Any help would be appreciated
I've tried a query
SELECT Max(ID) nextID FROM screenings
But I found this works until I delete the most recently created records because the Max ID is no longer the one previous of the next ID.
Any help would be appreciated
Comment