[eluser]opel[/eluser]
I think I should better explain my question and what I am trying to do. I am trying to make a selection from the database
Code:
$sql = "SELECT * FROM company WHERE company_user_id = ".$this->session->userdata('userid')."";
$query = $this->db->query($sql);
$result = $query->result_array();
if($result['company_id'] == 1)
{
echo "this";
}
else
{
echo "here";
}
However the problem I am having is that when you return items they are in a DB class object and to do the following statement I have to write the code as
Code:
if($result[0]['company_id'] == 1)
I just wondered if there was a way to do it like the 1st example ?