mysql_insert_id()
| From: | Boget, Chris | Date: | Mon, 25 Sep 2000 13:16:54 +0000 |
| Subject: | mysql_insert_id() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17366@lists.php.net to get a copy of this message | ||
I'm inserting data into a table with an auto_increment
field. The data is going in perefectly (with the A_I field
incrementing as it should; I can see this is true in the DB)
and there is no errors being returned.
However, when I try to executed the mysql_insert_id()
function (immediately after the query), it is returning
'0' (zero). Why?
Here is my field definition:
| ticket_number | int(15) unsigned | | PRI | 0 |
auto_increment |
I cannot see in the docs why it would fail and unfortunately,
mysql_insert_id() does not return why it would have failed
getting the auto_increment value.
I'm using PHP 3.0.5 and any help anyone could offer would
be greatly appreciated!!
Chris