考虑使用此函数从Codeigniter中的DB中检索数据:
function popular_list($limit=2)
{
$this->db->select('news.*');
$this->db->where('id',$this->uri->segment(3));
$this->db->where('publish',1);
$this->db->where('viewed',(>=5));
$this->db->order_by('id','DESC');
$this->db->limit($limit);
$query = $this->db->get('news');
return $query->result();
}
我收到了这个解析错误:
Parse error: parse error in C:\xampp\htdocs\misnews\application\models\home_model.php on line 113 Line 113 is : $this->db->where('viewed',(>=5));
我做错了什么?
答案 0 :(得分:1)
改变你的状况如下:
$this->db->where('viewed >= ',5);