get raw sql query from codeigniter query builder 1

get raw sql query from codeigniter query builder

$this->db->select('*');
	       $this->db->from('rankcertificate');
		  	$this->db->where('cin', $user);
		  	$this->db->where('year', '14/15');
		   $query = $this->db->get();

Here is what the above code is Doing:
1. We are selecting all the fields from the rankcertificate table.
2. We are selecting only those rows where the cin is equal to the user’s cin.
3. We are selecting only those rows where the year is equal to 14/15.
4. We are storing the result in the $query variable.

Similar Posts