Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Insert Into data insert statement of PHP+MySQL

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you the "PHP+MySQL Insert Into data insertion statement how to use", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "PHP+MySQL Insert Into data insertion statement how to use" this article.

The details are as follows:

The INSERT INTO statement is used to insert new records into the database table.

Insert data into a database table

The INSERT INTO statement is used to add new records to the database table.

Syntax:

INSERT INTO table_nameVALUES (value1, value2,....)

You can also specify the columns in which you want to insert data:

INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)

Note: SQL statements are not case-sensitive. INSERT INTO is the same as insert into.

In order for PHP to execute this statement, we must use the mysql_query () function. This function is used to send a query or command to a MySQL connection.

Example:

In the previous section, we created a table called "Persons" with three columns: "Firstname", "Lastname", and "Age". We will use the same table in this example. The following example adds two new records to the "Persons" table:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report