What are the differences between backtick and single quote? Can I use IF statement in a query as above?

后端 未结 1 1932
臣服心动
臣服心动 2020-11-29 09:52

In the codeigniter manual writes the following.

$this->db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter wil

相关标签:
1条回答
  • 2020-11-29 10:36
    1. In MySQL, backticks quote names, while single quotes create strings. If you have a column called select, MySQL would throw an syntax error when using this name without backticks -- like in SELECT select FROM foo -- as it would interpret it as keyword which may not occur there.

    2. This IF function can be used as a column specification in SELECT statements. See the MySQL reference.

    3. This function returns the value from the default column, if value is the empty string. Else it returns the value from value itself. The result will be called value. See the MySQL reference for details.

    0 讨论(0)
提交回复
热议问题