note 46147 added to function.mysql-insert-id

From: Date: Thu, 30 Sep 2004 22:57:42 +0000
Subject: note 46147 added to function.mysql-insert-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-77633@lists.php.net to get a copy of this message
minor correction to note created by crusaderky-at-libero-dot-it. I was confused by crusaderky's comment. When mysql_db_query() runs an insert command, the return value is always a boolean, and never any kind of mysql resource. Because mysql_insert_id() is only useful after running an insert command, passing it the return value of mysql_db_query() will never yield useful results. Instead, pass it the database handle returned from mysql_connect(). That handle is the "link_identifier". crusaderky makes a good case for this being a very good idea. ---- Manual Page -- http://www.php.net/manual/en/function.mysql-insert-id.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46147 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46147&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+46147&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#77633) next »