[eluser]chefnelone[/eluser]
Hello I have this funcion in a model.
I retrieve one value (product_name) for a table (products).
It works fine but... as you can see I'm using a foreaech() to echo the result.
Since I just get 1 result I don't want to use the foreach() statement.
Question: How do I echo the result NOT using foreach()
Code:
function get_product(){
$this->db->where("product_id", "10");
$this->db->limit(1);
$query = $this->db->get('products');
foreach ($query->result() as $row)
{
echo $row->product_name;
}
}
Thanks