[eluser]ede196620[/eluser]
i am getting this error anyone know what is could be the cause of this ? i think its something with the model but cant figure out.
Code:
Error Number: 1054
Unknown column 'id' in 'order clause'
SELECT * FROM (tblquestions) ORDER BY id asc LIMIT 5
Filename: C:\wamp\www\Surva\system\database\DB_driver.php
Line Number: 330
MODEL
Code:
class Display_model extends CI_Model{
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);
}
}
?>