How to write php modification statement

藏色散人
Release: 2023-03-06 16:46:02
Original
2920 people have browsed it

The PHP modification statement is "update student set field 1='new value 1,...'where id= $id",...;", where the update statement is used to modify the data in the database table.

How to write php modification statement

Recommended: "PHP Video Tutorial"

PHP sql modification statement

Grammar:

$sql = “update student set 字段1='新值1,…'where id= $id”,…;
Copy after login

Note: The modified keyword is update, not update. The conditions after where can be the same as the modified content.

PHP MySQL Update

The UPDATE statement is used to modify data in the database table.

Update data in the database

The UPDATE statement is used to update existing records in the database table.

Syntax

UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value
Copy after login

Note: Please pay attention to the WHERE clause in UPDATE syntax. The WHERE clause specifies which records need to be updated. If you want to omit the WHERE clause, all records will be updated!

In order for PHP to execute the above statement, we must use the mysqli_query() function. This function is used to send queries or commands to the MySQL connection.

The above is the detailed content of How to write php modification statement. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!