I have a mysql table for capturing transactions. I am trying to display data in multiple php/html tables based on the available categories in the same table. sample data from my table is given below.
Date Category Particulars type Amount
-----------------------------------------------------------
01.12.17 Donation Received from X Receipt 500.00
10.12.17 Donation Received from Y Receipt 200.00
15.12.17 Medical Aid Paid to A Payment 100.00
20.12.17 Expense Building Rent Payment 50.00
Is it possible to execute by below query multiple times dynamically based on the distinct value available in category field. This is to populate query data in multiple tables in a single PHP page.
select * from my_table where category = 'Donation';
select * from my_table where category = 'Medical Aid';
...
...
and the expected result is like below...
Date Category Particulars type Amount
-----------------------------------------------------------
01.12.17 Donation Received from X Receipt 500.00
10.12.17 Donation Received from Y Receipt 200.00
-----------------------------------------------------------
-----------------------------------------------------------
Date Category Particulars type Amount
-----------------------------------------------------------
15.12.17 Medical Aid Paid to A Payment 100.00
-----------------------------------------------------------
-----------------------------------------------------------
Date Category Particulars type Amount
-----------------------------------------------------------
20.12.17 Expense Building Rent Payment 50.00
The values in the category table my change. I trying to display the output of the first query in a separate html table and the second one on another.