MySQL query with quotes and no quotes difference
When the database field ID is an integral type
Select ID from table where id=1
And
Select ID from table where id= ' 1 '
Two SQL is OK, but the first SQL does not have to be implicitly converted,
In JavaScript, improper use of single quotes and double quotes may result in js Code conflicts and JavaScript cannot run correctly. It is easy to resolve the conflict between single quotes and double quotes in JavaScript, we only need to use
For beginners who don't have much coding experience, the correct use of PHP quotes is a headache, often resulting in errors in the program due to incorrect use of PHP quotes. Now let's give you a concrete introduction to the correct use of PHP
For beginners who don't have much coding experience,
first think about all the words in PHP (actually called symbols) there are several categories.
1.php,mysql two-side keywords and functions. For example Echo,print,mysql_connect and so on. These
PHP magic quotes. The security of PHP lies in its default configuration of php. the ini-dist contains magic_quotes_gpcOn, which is called "MagicQuote". it is useful for PHP beginners. "Although the security of SQL injection in PHP lies in its
Replacement of single quotes in HTML encode (reprinted)2. When using HTML encode, we need to replace the single quotation marks, double quotation marks, and angle brackets.
When you replace single quotes, we have two options:
1. Replace with &
& Nbsp; the security of PHP lies in its default configuration of php. the ini-dist contains magic_quotes_gpcOn, which is called "MagicQuote". it is very useful for PHP beginners, "although SQL injection is still possible when magic quotes are opened,
Sometimes some text is downloaded from the Internet, and it is found that the punctuation is in Half-width Latin. If it is a comma, a period is also said that a "find and replace" in Word, but the Western language does not have the first quotation
Sometimes some text is downloaded from the Internet, and it is found that the punctuation is in Half-width Latin. If it is a comma, a period is also said that a "find and replace" in Word, but the Western language does not have the first quotation
About the difference between single and double quotation marks and efficiency issues. A lot of friends understand is not very clear, always thought that single quotation marks and double quotes in PHP are interoperable, until one day, found that
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.