note 46147 deleted from function.mysql-insert-id by betz
| From: | betz@php.net | Date: | Fri, 01 Oct 2004 07:32:35 +0000 |
| Subject: | note 46147 deleted from function.mysql-insert-id by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77660@lists.php.net to get a copy of this message | ||
Note Submitter: ben at blarg dot net
----
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.