no mysql_insert_id() after $this->db->setQuery( "INSERT
mysql_insert_id() returns 0 after a succesfull insert.
It worked fine when I defined the insert with:
$database->setQuery( "INSERT....
$database->query();
echo mysql_insert_id();
//returns the id
but when I made a var from $database in a class the insert works but the id is 0
$this->db->setQuery( "INSERT....
$this->db->query();
echo mysql_insert_id();
//returns 0
I tried these, but thats just plane wrong.
echo mysql_insert_id($database);
echo mysql_insert_id($this->db);
which gives error:
Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in....
anyone?
Subject
Views
Written By
Posted
no mysql_insert_id() after $this->db->setQuery( "INSERT
6626
March 15, 2008 03:07AM
3670
March 15, 2008 12:30PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.