php - Codeigniter cannot get data from mysql table -
i following error while trying data database:
error number: 1066
not unique table/alias: 'faq'
select *from (faq
, faq
)where faq_title
= 'title 1'
please me find mistake. here model:
public function did_get_faq_data($title){ $this->db->select('*'); $this->db->from('faq'); $this->db->where('faq_title', $title); $query = $this->db->get('faq'); if ($query->num_rows() > 0){ return $query->result(); } else { return false; } }
in query table name called 2 times. unnecessary. replace $query = $this->db->get('faq'); $query = $this->db->get(); bold 1 correct.
public function did_get_faq_data($title){
$this->db->select('*'); $this->db->from('faq'); $this->db->where('faq_title', $title); $query = $this->db->get(); if ($query->num_rows() > 0){ return $query->result(); } else { return false; }
}
Comments
Post a Comment