Welcome Guest, Not a member yet? Register   Sign In
getting non-object error only in log file
#1

hi, I'm trying to get my record from DB in an object and echo in the view page.
I did this before and worked but this time I'm getting a weird error only in the log file NOT on the view page. also, the result is showing on the view page perfectly!

I wanna fix the error from my log file

Model:
PHP Code:
function get_one_by($cond=array()){
 
   $result $this->db->get_where($tablename$cond);
 
   if $result->num_rows() > ){
 
       return $result->row();
 
   }
 
   return FALSE;


Controller:
PHP Code:
$data['theForm'] = $this->form->get_one_by(array('URL' => $url));
$this->load->view('theForm'$data); 

View:
PHP Code:
echo heading($theForm->TITLE2); 

View Result:
Code:
<h2>a form</h2>

Log:
Code:
ERROR - 2017-09-10 11:39:34 --> Severity: Notice --> Trying to get property of non-object /Applications/XAMPP/xamppfiles/htdocs/xx/xx.php 7

Thanks for any help
Reply


Messages In This Thread
getting non-object error only in log file - by ardavan - 09-09-2017, 09:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB