Need help with query
Posted on 2006-06-10
PHP and SQL
Hello all. I am hoping for some help in determining the needed SQL and best way to create a resulting html SELECT input.
- I need to create an html select that contains a treelike category structure.
- I only want the categories to be in the select if there are files with the category id
- I want the select to demonstrate the level. For example:
Sub Cat 1
Sub Sub Cat 1
Sub Cat 2
Here are the details on the tables/fields
CategoryID (int pk)
Some categories do not directly have files associated. For example
[Small contains 1 file]
[Apartment contains 5 files]
Please help me come up with the sql and method that creates the options for the select. It will be fun :). I will award points quickly. I have to have this completed by tomorrow night. Thanks EE!