Help Please, should be simple enough for you pro's

Codes here !

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Wed Apr 02, 2003 4:27 am

Wed Apr 02, 2003 4:35 am


my plan is to create a graffiti database website.
i have 500 images to show.
they will be split into sections according to the area the photo is from. plan is to have a few different pages displaying thumnails from the different areas. then by clicking on a thumbnail, the appropriate image from the db is pulled into a universal page for displaying images.

rather like how works.

Basicaly, i have phpadmin, but i would like to know how i go about setting the tables up. I know how to physicaly add tables and such, but im not sure how to have them for my plan above to work.

do i store the images or paths to the db?
do i have one image table, with all the paths in?

do i have many tables (by area)?

its just the concept of what i need and where to put it all im stuck with i think.

i would really appreciate a few replys.


User avatar
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Wed Apr 02, 2003 5:39 pm

The way I setup my gallery is by having 2 different tables


photofile is setup like this


if you want you can have a few more like location and whatnot but I'm givin you the essentials.

photodir is setup like this


once again you can have more than that.

photo_id is the primary key for photofile and dir_id is a foreign key.

dir_id is the primary key for photodir.

This is basically how the db should be setup. This is pretty vauge and I don't have any code.

Check out my script

Poke around with the code and you might learn something. In the photo.class.php look for the functions get_children, get_ancestors, get_parent, print_menu_tree

it MIGHT help you out.

Post Reply