How can I obtain the status of records in a table output by querying the database on the PHP page?

Source: Internet
Author: User
How can I obtain the status of records in a table output by querying the database on the PHP page? For example, if a table is output by the database, if there is a field in multiple records, do you pay? after the output, how do I obtain whether the items in this table contain the unpaid status? Example: No. & nbsp; Name & nbsp; whether to pay 1 & nbsp; apple asked how to obtain the status of records in a table output by querying the database on the PHP page?
For example, if a table is output by the database, if there is a field in multiple records, do you pay? after the output, how do I obtain whether the items in this table contain the unpaid status?

For example:
Whether the ID name is paid
1 Apple paid
2 bananas paid
3. Grape payment

In this case, the return value is true. you can click a button.

If:

For example:
Whether the ID name is paid
1 Apple paid
2 bananas paid
3. Grape not paid

Returns false. this button is set to a state that cannot be clicked.

Thank you for your advice.
------ Solution --------------------
Php outputs mysql results by using arrays to extract the fields in the array that are paid or not, and judge one by one

The button status depends on whether the payment is made.
------ Solution --------------------

While ($ row = mysql_fetch_array ($ result )){
$ Ar [] = $ row ["payment status column"];
}
Foreach ($ ar as $ key => $ value ){
If ($ value = "unpaid "){
Echo" ";
} Else {
Echo" ";
}
}

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.