Re: How do I get the row id of the last insert?

2003-11-12 Thread Rudy Lippan
On Wed, 12 Nov 2003, Dan Anderson wrote: > If I insert a row into mySQL with an indexed auto incrementing column, > id, how do I get the id of the last inserted row? > For right now, you do this: $insertid = $dbh->{'mysql_insertid'}; However, In the next version of DBD::mysql you will be able

RE: How do I get the row id of the last insert?

2003-11-12 Thread Burak Gürsoy
: How do I get the row id of the last insert? > By the way, this isn't the place to ask that question. Sorry, PHP has a function to get the last row id. Didn't realize I had to use SQL. That explains why my search found nothing. :-) Thanks again, Dan

Re: How do I get the row id of the last insert?

2003-11-12 Thread Dan Anderson
> By the way, this isn't the place to ask that question. Sorry, PHP has a function to get the last row id. Didn't realize I had to use SQL. That explains why my search found nothing. :-) Thanks again, Dan

Re: How do I get the row id of the last insert?

2003-11-12 Thread Colin Wetherbee
Dan Anderson said: > If I insert a row into mySQL with an indexed auto incrementing column, > id, how do I get the id of the last inserted row? Use the LAST_INSERT_ID() function. Or, see these pages: http://www.mysql.com/doc/en/Getting_unique_ID.html http://www.mysql.com/doc/en/mysql_insert_id.ht

How do I get the row id of the last insert?

2003-11-12 Thread Dan Anderson
If I insert a row into mySQL with an indexed auto incrementing column, id, how do I get the id of the last inserted row? Thanks in advance, Dan