| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > PHP - Show multi files under category w/o using select |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
Registered User
Join Date: Dec 2006
Location: Oklahoma City, Oklahoma -US-
Posts: 24
|
PHP - Show multi files under category w/o using select
I'm using php 5.2, mysql 5.0.22 and a Windows 2000 server. My database is structured like so: DB: clfile , clfile_name clfile_size clfile_type clfile_title description date_entered cl_association, cl_assoc_id cl_file_id cl_category_id approved categories cl_category_id cl_category What I want to do is have all of the categories list out and each file list underneath them in a bullet list without having to use a form to select the categories. I have my code ready to where it will display one category and the files that are in that category but I'm not sure how to get all of them to do the same. here is my code: PHP Code:
Sorry about the long post. Thank you all for your help! |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Dec 2006
Location: Oklahoma City, Oklahoma -US-
Posts: 24
|
I'm pretty sure you are understanding my problem correctly, I changed PHP Code:
to PHP Code:
as a suggestion from someone else and it still returns as the one category. I'm pretty much a noob at PHP so is there something I'm leaving out? Thanks for the help Last edited by Repp55 : 09-05-2007 at 17:54. |
|
|
|
#4 (permalink) |
|
Web Developer
|
I've never used list() in such a manner, so I don't know for sure if it would work, but I have my doubts, try the following: PHP Code:
and see if that works for you. note that instead of $type you use $cat['cl_category_id'] - I would recommend always doing mysql queries like this as if you were to change something in your database you wouldn't have to adjust all of your php code Also try debugging, start with a single while loop for the categories and see if it prints out all the rows, then insert the other while loop inside and see if they work together nicely. |
|
![]() |