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 php deletes mysql lines

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "php how to delete mysql lines", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "php how to delete mysql lines" bar!

In PHP, rows can be deleted from the mysql database table through the DELETE statement, and the delete syntax is "DELETE FROM table_name WHERE some_column = some_value".

Operating environment of this article: Windows7 system, PHP7.1 version, Dell G3 computer

How does php delete mysql lines?

The PHP MySQL Delete:DELETE statement is used to delete rows from a database table.

Delete data from the database

The DELETE FROM statement is used to delete records from the database table.

Grammar

DELETE FROM table_nameWHERE some_column = some_value

Note: please note the WHERE clause in the DELETE syntax. The WHERE clause specifies which records need to be deleted. If you want to omit the WHERE clause, all records will be deleted!

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

Example

Please look at the "Persons" table below:

The following example deletes the records of all LastName='Griffin' in 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