Hi All, Need help with something,
Im newish to PHP so have very limited knowledge.
Basically I am making an admin panel for a friends beauty website.
I have two different tables in my database,
categories
+----+----------+
|cID | cCat |
+----+----------+
| 1 | Skin |
| 2 | Eye |
| 3 | Ear |
| 4 | Waxing |
| 5 | Massage |
| 6 | Nail |
+----+----------+
treatments
+----+-----------+-----+--------+----------+------------+-------+-----------+
|tID | tName | tCat| tPrice | tPicURL |tDescription| tTime | tPromote |
+----+-----------+-----+--------+----------+------------+-------+-----------+
| 1 |Hopi Candle|Ear | 4.00 |1.jpg | Sample | 1hr | False |
| 2 |Manicure |Nail | 5.00 |2.jpg | Saample | 2hrs | True |
| 3 |Spray Tan |Skin | 10.00 |3.jpg | Saaample | 3hrs | False |
+----+-----------+-----+--------+----------+------------+-------+-----------+
I want to loop through the results so they display as follows..
[cCat] or [tCat]
tName - tPrice - (Edit) - (Delete)
So each category(tCat or cCat) is displayed and then all the treatments(tName) and treatments prices(tPrice) are displayed underneath..
How do i do this??
I need an sql command and then need to know how to loop through results.
Thanks.
andrew0136
I will add a page for her so she can add categories and treatments so hense why i need a loop function.