0
dilip posted
How to print SQL query in codeigniter ?
I am working on search-related code to find products from the table in the databasebut I want to print the query to debug it properly.
$search = remove_special_characters($search);
$this->build_query();
$this->db->like('products.title', $search);
$this->db->order_by('products.is_promoted', 'DESC');
$this->db->limit(8);
$query = $this->db->get('products');
$query->result();
echo $this->db->print_query();
i am trying to print query but not sure getting error .