Skip to main content
July 3, 2009
Question

Help with structuring SQL databases for multiple photo galleries..help!?!

  • July 3, 2009
  • 2 replies
  • 3830 views

Hello all,

As a new PHP/SQL developer I have found great technical assistance from both this forum and from David Powers and his wonderful books. I am at a crucial point in my web development and although I believe I know which direction I need to go, I am still uncertain and so I appeal to you all for your help, especially David Powers.

The website I am building is one which will house many photo galleries. I was able to successfully modify the code provided in David Powers’ book ‘php Solutions’ so that I got the photo galleries constructed and working in the manner I desired.

That being said, a person browsing my website will be presented with a link to see the photo galleries. There will be five (5) categories in which the photos will be separated, all based on specific styles. Now that I have the galleries working, I need to know how to structure things so that I can create a page, like a TOC (table o’ contents) that shows all photo galleries by displaying a thumbnail image or two along with the description. Perhaps I’ll limit the TOC page to only show the latest 25 galleries, arranged with the most current always on top.

The way I have my galleries set up, I have a separate database for each one, containing the photo filenames and other relevant data. To build my TOC structure, should I have an overall database that contains each gallery database filename along with category? This is where I have no idea what I’m doing so if my question sounds vague, please understand I have no other idea how to ask.

The site will grow to the point of having hundreds, if not thousands of photo galleries. I simply want to know how to (organize them) or otherwise allow me to build a method to display them in a TOC page or pages.

I know this is a bit dodgy, but with some info and questions back from you, I feel confident that I should be able to get my point across.

Lastly, I am still developing this site locally, so I have no links to provide (though I feel that shouldn’t be necessary right now).

Many sincere thanks to you all in advance,

wordman

This topic has been closed for replies.

2 replies

Known Participant
August 3, 2009

Hi, sorry I can't be of any help but can you provide a link to the website you are working on?  I have some galleries on one that I am working on and would love to know/see what you have done thus far.  Thanks and good luck with your project.

D

August 3, 2009

dmreid,

Please contact me directly via email: wordman@g490.com

I have some excellent recommendations, such as David Powers' book, 'php Solutions' in this book he walks youthrough beginning php and MySQL and shows you how to construct a photo gallery, He is an amazing teacher. I took the code he uses in the book and modified it to shape the gallery into the form I needed.  What was most pleasing is that I was flying by the seat of my pants and the changes I made worked.

Drop me a note at the email shown above and I'll fill you in on more details.

Cheers,

wordman

Participating Frequently
July 3, 2009

We would need to have more info, but generally speaking, if the structure of the gallery data is the same for each gallery, then you only need a single database. That will simplify maintenance and accomplish your stated goal. How many tables are in each database currently?

July 3, 2009

bregent,

Thank you for the fast reply. In short, I will have photo galleries, each with approximately 45-50 photos each. As mentioned, there will be 5 different categories based on photographic style. I figured having each gallery with its own database would be simpler...the thought being, when I reach the quantity of tens of thousands of images (I already have several thousand with which I'm launching the site) that a single database would be monstrous and potentially a nightmare to edit.

My test database has two tables. One has a brief description of the photos in that particular gallery and the other table contains photo and thumbnail filename information.

Perhaps I can use just one page for the photo gallery that loads specific photosets when the link is selected? that would certainly cut down on the size of the website.

I hope this helps. I'm tying to learn this, and I appreciate your help!

Cheers,

wordman