我收到这个错误有人知道这可能是什么原因吗?我认为它与模型有关,但无法弄清楚。
错误号:1054
“订单子句”中的未知列“id”
SELECT * FROM (
tblquestions) ORDER BY
idasc LIMIT 5
文件名:C:\wamp\www\Surva\system\database\DB_driver.php
行号:330
模型
private $primary_key = 'QID';
private $table_name = 'tblquestions';
function get_paged_list($limit=10, $offset=0, $order_column='', $order_type='asc')
{
if (empty($order_column) || empty($order_type)) {
$this->db->order_by($this->primary_key, 'asc');
}
else {
$this->db->order_by($order_column, $order_type);
return $this->db->get($this->table_name, $limit, $offset);
}
}
function count_all()
{
return $this->db->count_all($this->table_name);
}
function get_by_id($id)
{
$this->db->where($this->primary_key, $id);
return $this->db->get($this->table_name);
}
function save($question)
{
$this->db->insert($this->table_name, $question);
return $this->db->insert_id();
}
function update($id,$question)
{
$this->db->where($this->primary_key, $id);
$this->db->update($this->table_name, $question);
}
function delete($id)
{
$this->db->where($this->primary_key, $id);
$this->db->delete($this->table_name);
}