Table Prefixes and Custom Module

edited May 2015 in Modules
Hi,
I just started creating my first Simple Module.
So I have a module call pressarticles and the accompanying table fw_pressarticles (in my database config the table prefix fw_ is specified). So at first the CMS complained about the id field of table fw_pressarticles missing. So I renamed articleID to id. So far so good... the overview page of the module ist working. Now the CMS complains on creation of a new item, that it cannot find the table pressarticles (without the prefix). Why doesn't the CMS realize the configured prefix at this point?

Error message:
Ein Datenbankfehler ist aufgetreten

Error Number: 1146

Table 'db403895_3.pressarticles' doesn't exist

SHOW FULL COLUMNS FROM `pressarticles`

Filename: core/MY_DB_mysqli_driver.php

Line Number: 142

KR
Habib

Comments

  • edited 6:16AM
    In addition... when I change the table name to pressarticles then I get the error, that the table fw_pressarticles was not found...
  • edited 6:16AM
    hmm OK... found it for myself... wrong constructor call... sorry. can be closed :-)
    I entered
    function __construct() {
    parent::__construct('pressarticles');
    }
    but must be
    function __construct() {
    parent::__construct('fw_pressarticles');
    }
Sign In or Register to comment.