Welcome Guest, Not a member yet? Register   Sign In
insert_id() not returning
#2

[eluser]Clooner[/eluser]
I fixed the problem myself with this workaround. Somehow CI has a bug with returning the last inserted id. Hope this helps someone else

Code:
function AddAdres($data)
{
  $this->db->insert("adres", $data);
  $query = $this->db->query('SELECT LAST_INSERT_ID()');
  $row = $query->row_array();
  return $row['LAST_INSERT_ID()'];
}


Messages In This Thread
insert_id() not returning - by El Forum - 09-05-2007, 04:39 AM
insert_id() not returning - by El Forum - 09-05-2007, 05:33 AM
insert_id() not returning - by El Forum - 10-26-2007, 01:37 PM
insert_id() not returning - by El Forum - 10-26-2007, 04:51 PM
insert_id() not returning - by El Forum - 10-26-2007, 05:20 PM
insert_id() not returning - by El Forum - 01-01-2008, 09:19 PM
insert_id() not returning - by El Forum - 02-17-2008, 09:52 AM
insert_id() not returning - by El Forum - 04-27-2009, 03:11 AM
insert_id() not returning - by El Forum - 04-27-2009, 03:36 AM
insert_id() not returning - by El Forum - 04-27-2009, 03:41 AM
insert_id() not returning - by El Forum - 04-01-2010, 08:46 PM
insert_id() not returning - by El Forum - 06-03-2010, 02:14 PM
insert_id() not returning - by El Forum - 02-27-2012, 10:06 PM
insert_id() not returning - by El Forum - 04-24-2012, 12:36 PM
insert_id() not returning - by El Forum - 04-27-2012, 02:47 AM
insert_id() not returning - by El Forum - 04-27-2012, 03:07 AM
insert_id() not returning - by El Forum - 04-27-2012, 09:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB