Re: mysql_insert_id always returns zero

From: Date: Sun, 25 Jun 2000 16:51:40 +0000
Subject: Re: mysql_insert_id always returns zero
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3002@lists.php.net to get a copy of this message
Hmmm...something rings a bell here...just a hunch Try either or both of the following echo "<hr>".mysql_insert_id()."<HR>"; // makes you think huh? or echo mysql_insert_id($result); // the mysql query identifier HTH, TomH At 09:23 AM 6/25/00 -0500, Dave Nuttall wrote:
I have a working PHP insert snippet that creates records as desired; however, if I issue "echo mysql_insert_id();" immediately after the line that performs the insert, the result is always ZERO, even though a new record was created with an appropriately incremented id value. I'm sure it must be missing something stupid, but I can't seem to figure out what the stupid part is! Please drop me a note if you can suggest an answer. Environment: RH 6.2, Apache 1.3.12, MySQL 3.22.30, PHP 4.0 TIA. Dave Nuttall San Antonio, TX -- 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
--------------------------------------------------------------------
Strategic Business Systems                  (978) 745-2332
                      http://BusinessWebs.com/
--------------------------------------------------------------------

« previous php.general (#3002) next »