Using backquote/backticks for mysql queries

前端 未结 6 512
温柔的废话
温柔的废话 2020-12-09 08:28

I have building MYSQL queries with backticks. For example,

SELECT `title` FROM `table` WHERE (`id` = 3)

as opposed to:

SELE         


        
6条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 09:24

    Backticks also allow spaces and other special characters (except for backticks, obviously) in table/column names. They're not strictly necessary but a good idea for safety.

    If you follow sensible rules for naming tables and columns backticks should be unnecessary.

提交回复
热议问题