I am getting this error "Fatal error: Call to undefined method CI_DB_mysql_driver::findVenueInfo()" when I try to use one of my models.
I have a view with this anchor:
echo anchor('welcome/searchVenue/' . $row->venue_id, $row->venue);
which generates a link like: http://localhost/ci-llmg/index.php/welcome/searchVenue/1
the method called is
function searchVenue()
{
$this->load->model('venues');
//get venue info
$data['info'] = $this->venues->findVenueInfo($this->uri->segment(3)); //this line generates the error
}
and the findVenueInfo function in the model (venues.php) is:
function findVenueInfo($id)
{
$data = array();
$this->db->where('id', $id);
$Q = $this->db->get('venues');
if ($Q->num_rows() > 0)
{
foreach ($Q->result() as $row)
{
$data[] = $row;
}
}
$Q->free_result();
return $data;
}
..but the result of this is Fatal error: Call to undefined method CI_DB_mysql_driver::findVenueInfo() I'm probably missing something stupid, but can't get it to work! What do you think?