1
考慮這個功能笨檢索從DB數據:笨DB where子句語法錯誤
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));
我在做什麼錯?
發表您的完整的錯誤文本 –
解析錯誤:解析用C錯誤:\ XAMPP \ htdocs中\ misnews \程序\型號\ home_model.php上線113 線113是:$ this-> db-> where('viewed',(> = 5)); –
@Ramnique:謝謝你的糾正:) –