i want to fetch that from mysql database using codeigniter framework php? -
i want fetch through model
select `id`, `name`, `visits`, `shortdes`, `photo` `products` `name` '$word' or `shortdes` '$word' , `valid` = 1 order `id` desc i used that, returned false
$this->db->order_by('id', 'desc'); $this->db->like('name', $word); $this->db->or_like('shortdes', $word); $this->db->where('valid', 1); $this->db->select('id, name, visits, shortdes, photo'); $query = $this->db->get('products'); what can use?
for debugging codeigniter's query builder query's, reccommend doing debug them , see query statements producing.
$this->db->order_by('id', 'desc'); $this->db->like('name', $word); $this->db->or_like('shortdes', $word); $this->db->where('valid', 1); $this->db->select('id, name, visits, shortdes, photo'); $query = $this->db->get('products'); echo "<pre>" die(print_r($this->db->last_query(), true)); when ran, output actual raw sql query being produced, , can debug there.
Comments
Post a Comment