PHP database additions and deletions to change the operation

Source: Internet
Author: User
Tags php database

1. INSERT statement: "INSERT into data table name (Field 1, Field 2,....) VALUES (" Value 1 "," Value 2 ",.....)"

For example: $sql = "INSERT into message (title,content,who) VALUES (' Message title ', ' Message content ', ' message person ')";

2. DELETE statement: "Delete from data table name where field = ' condition '"

For example: $sql = "Delete from message where id= ' 1";//delete id=1 data

3. Lookup Statement: "SELECT * from table name where condition (optional)"

For example: $sql = "SELECT * from Message";//query All data

4. Modify Statement "Update table name set field 1 = ' value 1 ', field 2 = ' Value 2 ', field 3 = ' Value 3 ' where field = ' condition '"

For example: $sql = "Update message set title= ' modify title ', content= ' modify content ', who= ' modify name ' where id= ' 1 '";

PHP database additions and deletions to change the operation

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.