• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mysqli $this->db->insert_id constantly returns 0

#7
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().
Reply


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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.