[eluser]khagendra[/eluser]
There is two mistaken you have done.
1. In model function, you forget to use $ sign.
here is ur code
Code:
function get_records() {
$q = this->db->get('tbltopic');
return $q->result();
}
}
--> Correct it like this
Code:
function get_records() {
$q = $this->db->get('tbltopic');
return $q->result();
}
}
2. In the view file, the argument in foreach loop.
here is ur code
Code:
<?php
foreach($result() as $row) // should not be $result()
{
echo $row->Topic . "<br />";
}
?>
--> It should be like this
Code:
<?php
foreach($result as $row)
{
echo $row->Topic . "<br />";
}
?>