我有以下控制器(supernavigationloggedin):
<?php
class Supernavigationloggedin extends CI_Controller {
function index(){
#get current session id
$currentSessionID = $this->session->userdata('session_id');
#get all the account row for the given sessionID
$data['info'] = $this->db->get_where('Client', array('session_id'=>$currentSessionID))->row();
#views
$this->load->view('supernavigationloggedin',$data);
}
}
?>
以及名为(supernavigationloggedin)的以下视图:
<div id="superNavigation">
<h5><strong>Welcome</strong>, <?php $info->fname; ?> <a href="#">Account Settings</a></h5>
<div class="clearL"> </div>
</div
>
它不断在线抛出错误:<h5><strong>Welcome</strong>, <?php echo $info['fname']; ?> <a href="#">Account
该消息:>>> Trying to get property of non-object
我试过了:<?php echo $info['fname']; ?> <?php echo $info->fname; ?>
但似乎都不管用。