Home  >  Article  >  Backend Development  >  Special symbol problems that are prone to errors when connecting to PHP database_PHP tutorial

Special symbol problems that are prone to errors when connecting to PHP database_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:34:21779browse

It should be noted that table names and field names are wrapped with operators ("`" on the "~" key in the upper left corner of the keyboard). The values ​​after VALUES are enclosed in single quotes, which is said to be an anti-injection measure.

Copy code The code is as follows:

$sql="INSERT INTO `table name` (`field 1`,`field 2`) VALUES ('value 1', 'value 2')";
mysql_query($sql);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322442.htmlTechArticleIt should be noted that table names and field names use operators (the "~" key in the upper left corner of the keyboard wrapped with "`"). The value after VALUES is enclosed in single quotes. It is said that...
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