Welcome Guest, Not a member yet? Register   Sign In
Getting next ID before insert
#4

[eluser]Ckirk[/eluser]
how about:
Code:
// users table for example
$query = $this->db->query('SELECT id FROM users ORDER BY id DESC LIMIT 1');
if ($query->num_rows() > 0)
{
  $user = $query->result();
  $next_id = $user[0]->id + 1;
}


Messages In This Thread
Getting next ID before insert - by El Forum - 06-24-2013, 07:16 AM
Getting next ID before insert - by El Forum - 06-24-2013, 07:44 AM
Getting next ID before insert - by El Forum - 06-24-2013, 11:41 AM
Getting next ID before insert - by El Forum - 06-24-2013, 01:35 PM
Getting next ID before insert - by El Forum - 06-25-2013, 05:29 AM
Getting next ID before insert - by El Forum - 06-25-2013, 05:34 AM
Getting next ID before insert - by El Forum - 06-25-2013, 06:04 AM
Getting next ID before insert - by El Forum - 06-25-2013, 06:23 AM
Getting next ID before insert - by El Forum - 06-25-2013, 06:25 AM
Getting next ID before insert - by El Forum - 06-25-2013, 09:50 AM
Getting next ID before insert - by El Forum - 06-26-2013, 12:10 AM
Getting next ID before insert - by El Forum - 06-26-2013, 06:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB