[eluser]the jan[/eluser]
Im trying to get a simple value from a field within my table but I always get the error "Trying to get property of non-object"... what am I missing?
Code:
function getNotifyNum()
{
if($this->uri->segment(3) != "") {
$user_data['verify_string'] = $this->uri->segment(3);
}
else
{
$user_data['verify_string'] = $this->input->post('verify_code');
}
$this->db->where('verify_string',$user_data['verify_string']);
$query = $this->db->get('submitters');
$user_row = $query->row();
$this->db->select('id,user_id,rand_id');
$this->db->where('user_id',$user_row->id);
$query_num = $this->db->get('submitted',1);
$num_row = $query_num->row();
return $num_row->rand_id;
}
The error is produced by the line with "return $num_row->rand_id;" even though I'm selecting that field and it exists in the database. I also already checked with count_all_results that there definitely is a result returned.
Is the underscrore in the field name a problem? Any ideas?
Thanks!