PHP basic operations for a database--update data

Source: Internet
Author: User

PHP basic operations for a database--update data

Main statement: $update = mysql_query ("Update user set password= ' abc ' where username= ' 123 '");

This means, update the user table, set the value of the password field to ABC, and filter the data to be username to 123. is to modify the user table inside the username for the 123 field inside the password, the value of password is ABC.

In the previous essay, I forgot to say where this is, this I understand as a filter, where the following is the condition you want to filter.

As an example:

SELECT * from user where username= " Tiaojian"

Query data table user inside the content of the username field. Where is the meaning of the filter.

At this time Echo $update, if successful, will return 1, using this 1 for future code.

( This can be used to change the password )

PHP basic operations for a database--update data

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.