blahblahship Posted May 18, 2007 Share Posted May 18, 2007 i have 2 columns, [id] and [name]. id is set to auto increment now i insert a new row (NULL, 'Bob') and i want to know what id is the new row. the [name] will have duplicates so don't ask me to "SELECT id FROM table WHERE name = 'Bob'" Link to comment https://forums.phpfreaks.com/topic/52009-insert-and-get-the-id/ Share on other sites More sharing options...
Wildbug Posted May 18, 2007 Share Posted May 18, 2007 LAST_INSERT_ID() Link to comment https://forums.phpfreaks.com/topic/52009-insert-and-get-the-id/#findComment-256303 Share on other sites More sharing options...
bubblegum.anarchy Posted May 18, 2007 Share Posted May 18, 2007 or mysql_insert_id() in php. Link to comment https://forums.phpfreaks.com/topic/52009-insert-and-get-the-id/#findComment-256706 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.