Home  >  Article  >  Database  >  8 recommended articles about backticks

8 recommended articles about backticks

黄舟
黄舟Original
2017-06-15 14:21:351896browse

We sometimes often encounter backticks (``) in MySQL statements. I didn't know what they meant at the beginning. What is their function? Select * from `member` order by posts desc limit 0,10; It is a symbol introduced to distinguish MYSQL reserved words from ordinary characters. For example: SELECT `select` FROM `test` WHERE select='field value' In the test table, there is a select field. If no backtick marks are used, MYSQL will treat select as a reserved word and cause an error. Therefore, there is MYSQL Reserved words as fields must be distinguished by backticks. Quotation marks are generally used for field values. If the field value is a character or string, quotation marks must be added, such as: select='field value'. Tables built without backticks cannot contain MYSQL reserved words, otherwise

1. Why do we need to add backticks in mysql statements

8 recommended articles about backticks

Introduction: Why do we need to add backticks in mysql statements?

2. Mysql Series (9) Single quotes and backticks

8 recommended articles about backticks

Introduction: The simplest way to avoid errors is to use backticks for reserved words such as table names, and use double quotes for other reserved words such as SQL statements. I usually try not to use single quotes. of. ,

3. Python built-in function——repr & str

8 recommended articles about backticks

##Introduction: This is consistent with the result obtained by conversion (backtick ``). As a normal function, it is sometimes useful to use this operation. For most types, this function attempts to return a string. When passed to eval(), the same object will be generated,

4. php execution operator

8 recommended articles about backticks

Introduction: PHP supports an execution operator: backtick (``). Note that this is not a single quote! PHP will attempt to execute what is enclosed in backticks as a shell command, and return its output information (i.e., it can be assigned to a variable rather than simply discarded to standard output). Using the backtick operator "`" has the same effect as the function shell_exec().

5. What is the difference between single quotes and backticks in MySQL?

Introduction: I used to use single quotes when creating tables and queries in MySQL. Later I found a problem. My classmates reminded me to use backticks. Recently I found that backticks can also be used. Problem: 1.2. I saw on the Internet that backticks are used to distinguish MySQL reserved words from ordinary characters. In this case, the second one can be explained, but why is the first one? What is the actual difference between single quotes and backticks? How does MySQL operate on these two symbols? Please explain, thank you.

6. $table = '`'.DB_pre.$table.''';Why are backticks used here?

Introduction: $table = '`'.DB_pre.$table.'''; Why are backticks used here?

7. php study notes (1)

Introduction: 1. The execution operator is the backtick (` `), equivalent to the shell_exec() function, executes a system command $out=`dir`; // List the current directory and file information 2. Define constants define(str, this is a const variableBR); echo str; 3 .Strings are enclosed in single or double quotes. The difference is that when a variable appears in double quotes, it will be replaced by the variable

8. What commands can be written in PHP backticks

Introduction: It can be executed directly, such as shutting down the computer, logging off and shutting down the computer. I have just started learning, I hope you will give me some advice

[Related Q&A recommendations]:

javascript - webpack compiles the content in the backtick but reports an error, but I write the string directly and no error is reported.

Confused about backticks in Linux?

javascript - How to implement the backtick `${name}` string template in es6

The word online on mysql 5.6 Is it a reserved word?

How to use the literal value of special characters in the vim plug-in vimwiki?

The above is the detailed content of 8 recommended articles about backticks. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn