In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "php delete database statement is what", the content of the explanation is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "php delete database statement is what" it!
Php deletes the database with statements such as "$sql=" DELETE FROME guo WHERE iid=75839 ";", where the delete statement can also delete all records in the table.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
What is the statement that php deletes the database?
Instantiate a data table (such as $uprim ()); $sql= "DELETE FROME guo WHERE iid=75839"; $result=mysql_query ($sql); if ($result) {echo delete success} else {echo failure}
Related introduction:
MySQL provides us with delete and truncate statements to delete data.
Definition of the delete statement:
Most of the delete statements are used when deleting data. Now let's look at the definition of the delete statement.
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name [WHERE where_definition] [ORDER BY...] [LIMIT row_count] delete from friends where user_name = 'simaopig'
Delete considerations:
From the grammatical structure, we can see that, like update grammar, we can omit the where clause. But this is a very dangerous act. Because if you do not specify the where clause, delete deletes all records in the table, and immediately.
A simple description of the truncate statement:
I have not touched this sentence before, nor have I used it. Because in general, delete statements are used to delete data. In fact, this truncate command is very simple, it means: delete all records of the table. It is equivalent to a delete statement that does not write a where clause. Its grammatical structure is:
TRUNCATE [TABLE] tbl_name
Here's a simple example. I want to delete all the records in the friends table, using the following statement:
Truncate table friends
Efficiency issues for truncate and delete:
If you want to delete all the data in the table, the truncate statement is faster than the delete statement. Because truncate deletes the table and then re-builds it based on the table structure, delete deletes records and does not attempt to modify the table. This is why when inserting data into a table that is emptied with delete, MySQL remembers the previously generated AUTOINCREMENT sequence and continues to use it to number AUTOINCREMENT fields. After truncate deletes the table, the table numbers the autoincrement field starting at 1.
However, the truncate command is fast, but it is not as secure for transactions as the delete command. Therefore, if the table on which we want to perform truncate deletion is transactional, this command produces an exit with an error message.
Thank you for your reading, the above is the content of "php delete database statement is what", after the study of this article, I believe you have a deeper understanding of what the php delete database statement is, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.