PHP 4.0 Bug #8101 Updated: mysql_insert_id
| From: | sniper@php.net | Date: | Tue, 05 Dec 2000 13:25:32 +0000 |
| Subject: | PHP 4.0 Bug #8101 Updated: mysql_insert_id | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40128@lists.php.net to get a copy of this message | ||
ID: 8101
Updated by: sniper
Reported By: tetherow@nol.org
Status: Feedback
Bug Type: MySQL related
Assigned To:
Comments:
What is the table like in which your query inserts data?
And what is the query like?
And have you read the following page?
http://www.php.net/manual/function.mysql-insert-id.php
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-12-04 14:23:14] tetherow@nol.org
MySQL insert_id function returns 0 on valid insert.
Using PHP 4.0.3pl1 and MySQL 3.23.28gamma.
configured using --with-mysql=/usr/local
$connection=mysql_pconnect($server, $username, $password);
$cursor=mysql_db_query('staff', $query, $connection);
$id=mysql_insert_id();
have also tried
$id=mysql_insert_id($connection)
In both instances $id is 0 yet the insert does succeed.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8101