Welcome Guest, Not a member yet? Register   Sign In
Is session->userdata supposed to return an array?
#4

[eluser]WanWizard[/eluser]
See the user guide.

$query->result() returns an array of objects, one for each record in the resultset. You should be doing something like
Code:
$query = $this->db->query("SELECT id FROM users WHERE user = 'asd'");

if ($query->num_rows() > 0)
{
    $row = $query->row();
    $id = $row->id;
}
else
{
    $id = FALSE;
}


Messages In This Thread
Is session->userdata supposed to return an array? - by El Forum - 08-17-2010, 06:48 PM
Is session->userdata supposed to return an array? - by El Forum - 08-18-2010, 02:14 AM
Is session->userdata supposed to return an array? - by El Forum - 08-18-2010, 05:58 AM
Is session->userdata supposed to return an array? - by El Forum - 08-18-2010, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB