Re: PHP 4.0 Bug #3295 Updated: MYSQL_INSERT_ID not working
| From: | Lars Torben Wilson | Date: | Thu, 27 Jan 2000 00:48:19 +0000 |
| Subject: | Re: PHP 4.0 Bug #3295 Updated: MYSQL_INSERT_ID not working | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-14941@lists.php.net to get a copy of this message | ||
Bug Database writes:
> ID: 3295
> User Update by: arni@linux.is
> Old-Status: Open
> Status: Closed
> Bug Type: MySQL related
> Description: MYSQL_INSERT_ID not working
>
>
>
> Full Bug description available at: http://bugs.php.net/?id=3295
>
This isn't a bug; you've given mysql_insert_id() the result id from
the query instead of the link id from the connection--i.e., the value
returned by mysql_connect() or mysql_pconnect(). The code shown should
work if you either supply that value or supply no argument; if none is
given, the most recently opened link is assumed.
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+