Hey there,
I'm trying to create a PHP script that will display categories of items and list the items in each category below the proper category. For example:
Philosophy
The Republic
Symposium
Nicomachean Ethics
Fiction
The Sun Also Rises
Crime and Punishment
Siddhartha
I am storing the categories in one table in a database (identifying each with a unique ID number), and storing the items in another table (tagging each with a number that corresponds to the category.
So the tables look like this:
Categories
1 Philosophy
2 Fiction
Books
2 The Sun Also Rises
1 The Republic
1 Symposium
2 Crime and Punishment
2 Siddhartha
1 Nichomachean Ethics
I would like to query the two tables with a LEFT JOIN that might look like this:
SELECT Categories., Books. FROM Categories LEFT JOIN Books ON Categories.catID = Books.catID
And then I would like to output the results as shown above. I know it is possible to do this in ColdFusion, by nesting the CFOUTPUT tags, but don't know if it is possible in PHP.
Thanks!