|
楼主 |
发表于 2013-2-22 20:29:13
|
显示全部楼层
不行啊,我先前就是这样获取值的,提示,
A PHP Error was encounteredSeverity: Notice
Message: Undefined index: uid
Filename: controllers/experience.php
Line Number: 23
控制器
public function view($id)
{
$data['text'] = $this->experience_model->view($id);
$uid = $data['text']['uid'];
print_r($data['text']);
$data['author'] = $this->experience_model->get_author($uid);
$this->load->view('view_experience',$data);
}
print_r($data['text']);
Array( [0] => stdClass Object ( [id] => 4 [title] => title [content] => content [keywords] => kw [browse] => 0 [helpful] => 1 [uid] => 2 [post_date] => 1340355010 ))
模型
function view($id)
{
$query = $this->db->get_where('experience', array('id'=>$id));
return $query->result();
}
$uid = $data['text']['uid']; 取不到值,不知为什么,晕死了
|
|