php/mysql - getting ID of query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is as much a mysql question as it is php.

 

What is the most reliable way to retrieve an auto_increment key/id for a
query you just inserted?

 

In other words, I compile all my data, insert it into a new row, and now I
want to retrieve the ID it created for it in the ID/key field.  Without
turning around and searching for the values I just inserted, is there a way
to get the ID?  The ID is the only field that is guaranteed to be unique in
each data set, which makes it questionable to search for the data you just
inserted, unless you searched for the *whole* data set.

 

Thanks

 

John


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux