Date: 10/31/02
- Next message: John Meyer: "RE: [PHP] SQL>Insert and recover the ID"
- Previous message: Chris Boget: "Re: [PHP] Good form class?"
- In reply to: Christian Ista: "[PHP] SQL>Insert and recover the ID"
- Next in thread: John Meyer: "RE: [PHP] SQL>Insert and recover the ID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> In a table, I have some fields and the primary key is an autoincrement
> field. I insert an row and I'd like to recover the ID used for the last
> record I inserted.
>
> For the moment, I do a select max(Id) just after the insert but there
> is, my be a best way to do it.
Stop.
Read this:
www.php.net/mysql_insert_id
---John Holmes...
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: John Meyer: "RE: [PHP] SQL>Insert and recover the ID"
- Previous message: Chris Boget: "Re: [PHP] Good form class?"
- In reply to: Christian Ista: "[PHP] SQL>Insert and recover the ID"
- Next in thread: John Meyer: "RE: [PHP] SQL>Insert and recover the ID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

