I am working my way through the display News section of the tutorials.
My News_model.php is just cut and past from the tutorial:
PHP Code:
<?php
class News_model extends CI_Model {
public function __construct()
{
$this->load->database();
}
public function get_news($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get('news');
return $query->result_array();
}
$query = $this->db->get_where('news', array('slug' => $slug));
return $query->row_array();
}
}
But when viewing the news page I get this error:
A Database Error Occurred
Error Number: 1146
Table 'kvpuctvh_igni857.adnews' doesn't exist
SELECT * FROM `adnews`
Filename: models/News_model.php
Line Number: 13
It is trying to select from table
adnews but the model clearly shows it is trying to query the
news table in the db. So why is it adding
"ad" to the front of the table name?
Confused.