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

Codes here !

Moderators: macek, egami, gesf

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

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

Postby gat » Wed Apr 02, 2003 4:35 am

hello,

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 http://graffiti.187aka357.com/pdb/ 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.

thanks
GAT - kriminal_youth@hotmail.com

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Wed Apr 02, 2003 5:39 pm

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

photofile
photodir

photofile is setup like this

photo_id
dir_id
filename

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

dir_id
parent_id
name

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 http://squitosoft.angrymosquito.com

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.


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron