[eluser]justmelat[/eluser]
What am I doing wrong?
Here is my controller:
function contractors()
{
$data['title']="PureStaff-Contractors";
$data['heading']="Active Contractors View";
$data['query']=$this->db->get('contractors');
$where = "active='Yes'";
$data['query']=$this->db->where($where);
$this->load->view('contractors_view.php', $data);
}
Here is part of the view:
<h2><?php echo $heading; ?></h2>
<p><?php echo anchor('purestaff/index','Return to Home Page');?> /
<?php echo anchor('purestaff/addContractor','Add New Contractor');?></p>
<hr align="left" width="75%" size="2%" color="red">
<
?php foreach($query->result() as $row): ?>
<h3><?php echo $row->fname ?> <?php echo $row->lname?></h3>
<h5><?php echo anchor('purestaff/conEdit/'.$row->id, 'Edit');?> / <?php echo anchor('purestaff/contractorDelete/'.$row->id, 'Delete');?></h5>
I get this error:
Fatal error: Call to undefined method CI_DB_mysql_driver::result() in C:\EasyPHP20b1\www\ci\system\application\views\contractors_view.php on line 13
Line 13 is the line above in red