Re: How do I get last inserted ID?
| From: | David Robley | Date: | Fri, 02 Feb 2001 03:50:39 +0000 |
| Subject: | Re: How do I get last inserted ID? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-37779@lists.php.net to get a copy of this message | ||
On Fri, 2 Feb 2001 14:13, Sandeep Hundal wrote:
> Hi All,
>
> just a quick question. Say my script is inserting values into a
> database, which has an autoincremental id. Now I usually send out a
> mail also with the contents of the inserted stuff. The only problem
> is that of the ID field. How can I get the script to determine what
> id number was given to that row?
>
> thanks
>
> /sunny
If you are using mysql, mysql_insert_id will do that for you.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA