Welcome Guest, Not a member yet? Register   Sign In
Trying to get property of non-object

(06-25-2017, 06:21 AM)juanrapma Wrote: Hello, I am trying to pass a function through another array, but this indicates the following message

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/Home.php
Line Number: 60
File: /storage/ssd4/361/2007361/public_html/application/controllers/Home.php
Line: 60
Function: _error_handler
File: /storage/ssd4/361/2007361/public_html/index.php
Line: 315
Function: require_once

But when I do a print_r in the array, I get the values, but I can not get that value.

This is a code:

PHP Code:
public function verifySession()

 if (empty(
$code $this->session->userdata ['number'];
$query $this->db->query('SELECT * FROM users WHERE code = '.$code.' ');
$row $query->row();
$activo $row->activated;

$activado = array('verificacion' => $activo );


PHP Code:
public function index()

$data['ayb_link'] = $this->link_ayb;
$data['mantenimiento_link'] = $this->link_mantenimiento;
$data['recepcion_link'] = $this->link_recepcion;
$data['title'] = $this->title¬† 


¬†$this->verifySession()->activado ['verificacion'];

$this->load->view('home' $data);


Try this:
$activado = $this->verifySession();
print  activado ['verificacion'];
Practice | Practice | Practice

Messages In This Thread
RE: Trying to get property of non-object - by Midhun Mohanan P - 06-25-2017, 09:28 PM

Theme © iAndrew 2016 - Forum software by © MyBB