|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I have a question regarding an autoincrement insert, I would like to pull the new number that is inserted into the table immediately after the insert. Is there a way to get the number that was inserted without having to run a select to find this out. I know it is stored in the database but I cant find a function in PHP that will pull this information.
|
|
#2
|
|||
|
|||
|
The function for PHP you need is:
$lastInsertedID = mysql_insert_id(); This will give you the last inserted auto-incremented ID. Peter |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > autoincrement insert |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|