Re: A small question - Mysql_insert_id
| From: | Julie Meloni | Date: | Sat, 01 Jun 2002 14:42:55 +0000 |
| Subject: | Re: A small question - Mysql_insert_id | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100223@lists.php.net to get a copy of this message | ||
r> I am inserting a row into a table with this structure
r> id (auto increment)
...
Assuming you mean ID int not null primary key auto_increment (or
something like that).
r> Then according to the manual I have to use (to quote)
r> "printf ("Last inserted record has id %d\n", mysql_insert_id());"
r> will this return the row number or the "id" fields value..?
FYI, you could:
a) try it and see
b) see what the manual has to say: http://www.php.net/manual/en/function.mysql-insert-id.php
The answer is "Gets the id generated from the previous INSERT
operation".
- Julie
--> Julie Meloni
--> julie@thickbook.com
--> www.thickbook.com
Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20