"lastInsertedID" might not be what you want, read the documentation about
. It'a a highly situational function ...
To get the last value of a auto-increment ID, usually:
- Code: Select all
SELECT MAX(ID) FROM `MyTable`;
does the job - as long as the last insert didn't re-use a "ID hole" from a previously deleted record. But since such can only occur due to "manual" overrides of the auto-increment, you should know about ;-)
Assuming SQLYogas "lastInsertedID" does what the equally named MySQL function does, and that you can translate my SQL to SQLYoga, hope I could help ;-)
Livecode programming until the cat hits the fan ...