Home  >  Article  >  Backend Development  >  identity_insert PHP insert syntax detailed explanation

identity_insert PHP insert syntax detailed explanation

WBOY
WBOYOriginal
2016-07-29 08:38:041125browse

There was this sentence in the last program:
$exec="insert into info (ename,pcname) values ​​('".$_POST["ename"]."','".$_POST["pcname"]. "')";
Explain the meaning of this sentence. The syntax for inserting records in SQL is:
insert into table name (field name 1, field name 2, ...) values ​​("value of field 1", "value of field 2", ...)
The previous program It is based on this syntax. It should be noted that I have added quotation marks to the values ​​in the values ​​brackets. This is because the corresponding field type is varchar. If the corresponding field type is int or the like, then it should be Remove the quotes! Be sure to pay attention.

The above introduces the detailed explanation of identity_insert PHP insert syntax, including the content of identity_insert. I hope it will be helpful to friends who are interested in PHP tutorials.

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