“Aaaaagh!”, I was heard to scream several times. Why won’t the damn thing return the last id. I’m doing exactly as I’ve done a million times before, yet it aways returns a zero. I don’t have to be transaction based to use last_insert_id do I?!? Well, close actually. Not in a transaction, no. But on the same database connection. See, I was issuing an insert command via the phpMyAdmin program, then trying to get the last id in code.
So:
SELECT LAST_INSERT_ID();
…does indeed work. Grrr.
Home > About This Post
This entry was posted by Chris Andrews on Saturday, May 13th, 2006, at 5:10 am, and was filed in Databases.
Subscribe to the
RSS 2.0 feed for all comments to this post.
Post a Comment