Hello,
Please could someone tell me how to retrieve an incremental variable from MYSQL as soon as it is inserted? (i.e. before another variable can be inserted)
Many thanks.
Stu
How to retrieve an incremental variable as soon as it is ins
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: How to retrieve an incremental variable as soon as it is
If you have an auto-increment column you can retrieve the last value (for said column) from an INSERT query by using mysql_insert_id()
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering