What is the meaning of backslashes in MySQL syntax?

Source: Internet
Author: User
SELECT function_baseurl . id As id from function_baseurl WHERE TRUE

The previous sentence is a colleague's code, he put all the fields are backslash, resulting in the code is particularly ugly, so what is the point?

Reply content:

SELECT function_baseurl . id As id from function_baseurl WHERE TRUE

The previous sentence is a colleague's code, he put all the fields are backslash, resulting in the code is particularly ugly, so what is the point?

Personally, this is telling the compiler to break the line! It doesn't make much sense. Personal opinion is for reference only

Excuse me, is it ' or \

` 是 mysql 的转义符,只要你不在列名、表名中使用 mysql 的保留字或中文,就不需要转义其他数据库也同样有保留字,如使用的话也同样需要转义,只是转义符不同而已
\ 是对字段输入内容的转义,以确保这些数据不会引起程序,特别是数据库语句因为特殊字符引起的污染而出现致命的错误。在magic_quotes_gpc=On的情况下,如果输入的数据有单引号(’)、双引号(”)、反斜线()与 NUL(NULL 字符)等字符都会被加上反斜线。这些转义是必须的。
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.