Bug #17049 Updated: mysql_insert_id not working

From: Date: Mon, 06 May 2002 20:03:46 +0000
Subject: Bug #17049 Updated: mysql_insert_id not working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-7075@lists.php.net to get a copy of this message
ID: 17049 Updated by: t.tremaine@open-for-biz.com -Summary: mysql_insert_db not working Reported By: t.tremaine@open-for-biz.com -Status: Feedback +Status: Open Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: sorry. I meant mysql_insert_id Previous Comments: ------------------------------------------------------------------------ [2002-05-06 15:49:12] sander@php.net mysql_insert_id() only returns something if: -the most recent query was an INSERT query -AND you're using a AUTO_INCREMENT (and thus PRIMARY KEY) field in the table you're inserting data to. If that's not the case, mysql_insert_id() will return 0. ------------------------------------------------------------------------ [2002-05-06 15:40:13] mfischer@php.net I think you meant mysql_insert_id(), right? ------------------------------------------------------------------------ [2002-05-06 15:34:55] t.tremaine@open-for-biz.com when mysql_insert_db is used without a parameter, as in mysql_insert_db(), it seems to always return 0 instead of the primary key of the most recent insert. It works fine when the db_link is provided as a parameter. Same problem in PHP 4.0.6 running on Linux. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1

« previous php.bugs (#7075) next »