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'" Quote Link to comment Share on other sites More sharing options...
Wildbug Posted May 18, 2007 Share Posted May 18, 2007 LAST_INSERT_ID() Quote Link to comment Share on other sites More sharing options...
bubblegum.anarchy Posted May 18, 2007 Share Posted May 18, 2007 or mysql_insert_id() in php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.