How to safely use reserved SQL names?

前端 未结 3 1168
半阙折子戏
半阙折子戏 2020-11-29 13:50

I\'m using Cakephp 3 using sqlserver as datasource server. I am sure there\'s no problem with my database connection.. as home.ctp prompts that I am connected to my database

3条回答
  •  一生所求
    2020-11-29 14:26

    You can use this code before problematic query:

    $this->Tests->connection()->driver()->autoQuoting(true);
    

    and when you are finished you can turn auto quoting off:

    $this->Tests->connection()->driver()->autoQuoting(false);
    

    So bad performance would be only on problematic query.

提交回复
热议问题