Search code examples
phpmysqldatabasecakephpmode

How to ignore prefix on certain models? CakePHP


I have to read data from a table called sys_sbu which is in the same database as my app. However, I have set tr_ to be the prefix of all my tables. When I tried to use $useTable = 'sys_sbu' on my model, it determined it to be tr_sys_sbu. How do I force it to ignore the prefix?


Solution

  • So, try this:

    class ExampleModel{
        var $useTable = "example";
        var $tablePrefix = "";
    }
    

    It's alright now :D