How do I structure the below query in Codeigniter. I can't seem to figure it out.
This is the function in my model:
public function update_daily_inventory()
{
foreach ($this->parseInventoryHtml() as $item) {
$_item = $this->db->query('SELECT COUNT(*) as `count` FROM product WHERE product_code = "' . $item['sku'] . '"');
}
return $_item;
}
I want to use an array key as the where variable. Apologize if this is simple I am new to coding. This keeps returning 0.