When to use single quotes, double quotes, and backticks in MySQL

后端 未结 13 1059
一个人的身影
一个人的身影 2021-01-26 10:55

I am trying to learn the best way to write queries. I also understand the importance of being consistent. Until now, I have randomly used single quotes, double quotes, and backt

13条回答
  •  日久生厌
    2021-01-26 11:36

    Single quotes should be used for string values like in the VALUES() list.

    Backticks are generally used to indicate an identifier and as well be safe from accidentally using the reserved keywords.

    In combination of PHP and MySQL, double quotes and single quotes make your query writing time so much easier.

提交回复
热议问题