I'm getting this string (raw copy and paste)
SELECT `ing_names`.`name` FROM `ingredients` INNER JOIN `ing_names` ON `ingredients`.`id_name` = `ing_names`.`id` WHERE `id_type` = '1'
SELECT `ing_names`.`name` FROM `ingredients` INNER JOIN `ing_names` ON `ingredients`.`id_name` = `ing_names`.`id` WHERE `id_type` = '1'
From this test code (in my model)
$this->db->select('ing_names.name','ingredients.stock');
$this->db->from('ingredients');
$this->db->join('ing_names','ingredients.id_name = ing_names.id', 'inner');
$this->db->where('id_type','1');
$this->db->get();
echo $this->db->last_query();
Why is query builder returning this query?
I'm trying to do this query
SELECT `ing_names`.`name`, `ingredients`.`stock`
FROM `ingredients`
INNER JOIN `ing_names`
ON `ingredients`.`id_name` = `ing_names`.`id`
WHERE `id_type` = 1