Welcome Guest, Not a member yet? Register   Sign In
mysqli $this->db->insert_id constantly returns 0

MySQLi resets the insert id upon committing the transaction (intended behaviour). When it's without a transaction, I think that behaviour differed between PHP versions, due to a bug. Try wrapping it in a transaction, by calling trans_begin(), then the insert(), then the insert_id(), then commit().

Messages In This Thread
RE: mysqli $this->db->insert_id constantly returns 0 - by katz - 06-05-2015, 01:20 AM

Theme © iAndrew 2016 - Forum software by © MyBB