我收到此错误任何人都知道这可能是什么原因?我认为它与模型有关,但无法弄清楚。
错误号码:1054
'order clause'中的未知列'id'
SELECT * FROM (
{tblquestions {1}} ID为) ORDER BY
文件名:C:\ wamp \ www \ Surva \ system \ database \ DB_driver.php
行号:330
MODEL
asc LIMIT 5
答案 0 :(得分:1)
请将ID更改为qid:
SELECT * FROM (tblquestions) ORDER BY qid asc LIMIT 5
您在查询中提供了错误的列名。
答案 1 :(得分:0)
包含使用order by, having, group by
子句时要选择的所有列。
说 - SELECT ID FROM (tblquestions) ORDER BY ID asc LIMIT 5
或者如果你想也这样做SELECT * FROM (tblquestions) ORDER BY tblquestions.ID asc LIMIT 5
必须在应用order by, having, group by
子句之前专门选择ColumnName ..
Here you can change this---
$this->db->order_by($this->primary_key,'asc'); to
$this->db->order_by("tblquestions".$this->primary_key,'asc');