I am using Codeigniter and Datamapper for DB Query. My controller is as follows
function fetch_interested_in()
{
$in = new Interested_in();
$in -> get();
$interested_in = array();
foreach($in -> all as $data)
{
$interested_in[$data -> in_id] = $data -> in_title;
}
return $interested_in;
}
And my view file is as follows
<?php foreach($interested_in as $in)
echo form_checkbox('in_in[]', $in -> in_id);
?>
There are 3 rows in my table called Interested_in. 2 columns are there and names are in_id and in_title. When I run the code I get the following error in page at 3 places one after another.
**
A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: views/poverview.php Line Number: 137
**
Please let me know where am I going wrong. I'll really be very thankful to you. Thanks in advance.