• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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