Page 1 of 1

last_insert_id return 0

Posted: Fri Apr 27, 2007 2:42 pm
by spraypray12
Whatever i try, it still retuns 0. In php script, in mysql query browser, every insert id return 0.

MySQL version 4.1.2

Posted: Fri Apr 27, 2007 2:50 pm
by John Cartwright
Post your code.

Posted: Fri Apr 27, 2007 2:53 pm
by Burrito
Jcart wrote:Post your code.
and your table structure.

Posted: Fri Apr 27, 2007 2:56 pm
by volka
http://dev.mysql.com/doc/refman/5.0/en/mysql-insert-id.html wrote:Note that mysql_insert_id() returns 0 if the previous statement does not use an AUTO_INCREMENT value.