To Resolve the error add one more check before looping through the data
Check Added ( foreach ($query && $query->result() as $row) )
Final Code.
$query = $this->db->query("YOUR QUERY");
foreach ($query && $query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->body;
}
No comments:
Post a Comment