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

identity_insert PHP insert syntax detailed explanation

WBOY
Release: 2016-07-29 08:38:04
Original
1167 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template