Uploading Images to a Category/SubCategory with PHP/MySQL
Posted on 2005-05-10
Okay - I'm attempting to create an 'admin' section of my website so I can upload my images into a category or appropriate subcategory instead of having to manually add them/code them on the HTML pages....
I have three tables:
icon_categories, icon_subcats, icon_images.
the categories table has 'cat_id' and 'cat_name', icon_subcats has 'sub_id', 'sub_name', 'cat_id', and the icon_images table has 'icon_id', 'icon_filename', 'icon_caption', 'cat_id', 'sub_id'.
I want to have two drop down boxes, the file field to upload the image, and then a text field to input the caption.
The first drop down box will be categories, and will be populated from the mysql database. The second drop down will be subcats - and I want it to populate with the subcats that match the original category selected. (IE When I select the 'movies' category, I want the second drop down to populate with all the subcats that go in movies).
That is what I'm having the first problem with. I've tried modifying several scripts... but finally just gave up. o.O
Then, I need the file to upload, I'm not picky about renaming or anything like that... I just need it to upload, and be stored in the database so that when I get around to coding the 'view' part of the album, I'll be able to pull it from there.
I don't need thumbnails, as all the images are only 100x100 pixels anyway.
Any help would be greatly appreciated... I'm pulling out my hair trying to figure out how this would work.