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"
";
}
}