Re: PHP & MySQL get value of auto_increment field of newdata
| From: | Tom Harris | Date: | Wed, 08 Nov 2000 19:40:11 +0000 |
| Subject: | Re: PHP & MySQL get value of auto_increment field of newdata | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24367@lists.php.net to get a copy of this message | ||
Coolness! Thanks,
You'd think between the 3 books and have one of them would mention this
function, but NO not one mention of it!
Thanks again!
"Matt Schroebel" <MSchroebel@hsus.org> wrote in message
news:sa095214.017@hsus6.hsus.org...
>>> "Tom Harris" <stry_cat@yahoo.com> 11/08 1:06 PM >>>
>I use a PHP script to take data from a web form and insert it into a MySQL
>database. The database has an id field that is AUTO_INCREMENTing and the
>primary key. I want to be able to retrieve the id field that belongs to
the
> record I just inserted.
Just use mysql_insert_id()
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net