![]() |
$query = $this->db->get('news'); - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: $query = $this->db->get('news'); (/showthread.php?tid=66185) |
$query = $this->db->get('news'); - Ragwin - 09-17-2016 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 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. RE: $query = $this->db->get('news'); - Wouter60 - 09-17-2016 Check your database settings in application\config\database.php One of the elements in de $db['default'] array is 'dbprefix'. Does this have the value 'ad' ? RE: $query = $this->db->get('news'); - Ragwin - 09-18-2016 (09-17-2016, 11:52 PM)Wouter60 Wrote: Check your database settings in application\config\database.php Yes! When I first installed Igniter the db config had ad as the dbprefix. Simples. Thx. |