Hello,

If I am relying on MySQL's AUTO_INCREMENT feature for the id for a table, how
can I reliably retrieve the ID of an item I just entered into the database?

For instance, I have a table that stores first names, and has an id field that
is generated via AUTO_INCREMENT.  However, this id will uniquely identify the
first name we enter (say "James") for the rest of my application.  So, if I am
adding entries to my table, I insert "James" and a unique id is generated.  How
do I get this id out of the table again?  If I, for instance, add "James" again
later and want to get the id of this new "James", how would I do it?

The problem is that there are many "James" entries in our database, but I need
to get the unique of this "James" I just put in.  I can't search for "James"
because there are lots of them in the table.

Any ideas?  Thanks a lot.

-Rob Crowell

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to