Re: mysql_insert_id

From: Date: Mon, 25 Sep 2000 14:03:22 +0000
Subject: Re: mysql_insert_id
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17388@lists.php.net to get a copy of this message
Try calling the mysql_insert_id($dbh) where $dbh is the link identifier from the mysql_pconnect() or mysql_connect() function. -- Scott On Fri, Sep 22, 2000 at 08:22:11AM -0500, Boget, Chris wrote: > 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 > > -- > 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 -- Scott

« previous php.general (#17388) next »