Php questions about database modification and deletion

Source: Internet
Author: User
Php about database modification and deletion problems in php use MYSQL database to delete and modify posts. what should I do? A: Thank you. Generally, the Post id is read, then, delete the post based on the post id parameter on the input deletion operation page ., Use three SQL statements to complete INSERTINTO 'Te' ('1', '2', '3', php about database modification and deletion
How can I delete and modify a post using the MYSQL database in php? A: Thank you.

------ Solution --------------------
Generally, the Post id is read and then deleted based on the post id parameter on the input deletion operation page.
------ Solution --------------------
Complete with three SQL statements

Insert into 'Te' ('1', '2', '3', '4', '5') VALUES ('1', '2', '3 ', '4', '5 ');
UPDATE 'Te' SET '2' = 'x', '3' = 'x ', '4' = 'X' WHERE '1' = '1' AND '2' = '2' AND '3' = '3' AND '4' = '4' AND '5' = '5' LIMIT 1;
Delete from 'Te' WHERE '1' = '1' AND '2' = 'x' AND '3' = 'x' AND '4' = 'x' AND '5' '= '5' LIMIT 1;
------ Solution --------------------
Discussion
Generally, the Post id is read and then deleted based on the post id parameter on the input deletion operation page.

------ Solution --------------------
Obtain the primary key
Delete from tablename where id =?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.