Date: 05/29/98
- Next message: sr: "[PHP-DEV] CVS update: php3"
- Previous message: steve <email protected>: "[PHP-DEV] Bug #416: mysql_insert_id() always returns 0"
- In reply to: steve <email protected>: "[PHP-DEV] Bug #416: mysql_insert_id() always returns 0"
- Next in thread: Rasmus Lerdorf: "Re: [PHP-DEV] Bug #416: mysql_insert_id() always returns 0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 20:32 29/05/98 -0000, steve <email protected> wrote:
>From: steve <email protected>
>Operating system: Solaris2.6
>PHP version: 3.0 Release Candidate 5
>PHP Bug Type: MySQL related
>Bug description:
>I use the following code to insert a new row with
>autoincrement field in mysql:
>
>$query = "Insert into cart_user (uname,upass,email) ";
>$query .= "values ('$uname','$upass','$email')";
>$insert = mysql($database,$query);
>$user_id = mysql_insert_id();
>
>When I display $user_id, it is 0.
>
>What am I doing wrong?
Hrm, are you sure you have an AUTO_INCREMENT field in your table?
Zeev
-- Zeev Suraski <zeev <email protected>> For a PGP public key, finger bourbon <email protected>
- Next message: sr: "[PHP-DEV] CVS update: php3"
- Previous message: steve <email protected>: "[PHP-DEV] Bug #416: mysql_insert_id() always returns 0"
- In reply to: steve <email protected>: "[PHP-DEV] Bug #416: mysql_insert_id() always returns 0"
- Next in thread: Rasmus Lerdorf: "Re: [PHP-DEV] Bug #416: mysql_insert_id() always returns 0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

