Adding table prefix to join in Codeigniter

后端 未结 2 1151
耶瑟儿~
耶瑟儿~ 2021-01-17 01:02

I have Codeigniter setup to add the prefix kms_ to my active record queries. However, I am trying to do a join with two ON conditions and it doesn\'t prepend them.

R

2条回答
  •  被撕碎了的回忆
    2021-01-17 01:46

    You can simply add Prefix table name like this :
    for example your tables have myPrefix_ as prefix and one of them might be myprefix_user.
    After that in your config/database.php at the bottom of this page where you set your database name, username and password, You can see dbprefix and you can set your prefix as I mentioned above myPrefix_.
    At the end, You can simply call your table name for example $this->db->get('user') and automatically Codeigniter set your prefix at the first of it.

提交回复
热议问题