TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-15-2008, 09:29 PM   #1 (permalink)
The Contributor
 
Join Date: Oct 2008
Posts: 75
Thanks: 4
9three is on a distinguished road
Default Photo gallery best method to store?

I was planning on a working on a small project of a photo gallery. But I'm wondering what the best method to storing the pictures would be?

A) Upload them to a uploads folder - I don't know how customize you can be with this form

B) Store them in a database - lets me add things like title/comment/info of pic and I can show as an array.

Is there a better way or different method?

Thanks
9three is offline  
Reply With Quote
Old 12-15-2008, 09:41 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

I've never been a fan of storing BLOB data in a database for the reason that the database can become HUGE. I would say store them in a folder, and then keep a database to track them. Link them up via their names. That is my preferred way because it keeps the images external to the database, but still ties the database to the images.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 12-15-2008, 10:02 PM   #3 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

How you want to do it is up to you, each had their ups and downs.

Doing it out of a MySQL database would be the most secure way because you must have the proper credentials to get it one way or another. This is probably not required for a simple image gallery. MySQL can would be able to do this fairly efficiently if the files were under a few kb each (and under a few million rows) on a capable server (shared servers are not capable). I prefer not to store files in a BLOB on the database since it is always slower than the filesystem (hence the name FILEsystem).

Working with them in folders is less secure, but faster and easier to work with, that is what I recommend for this type of things. If you want private images, store them below the webroot and have PHP display them for you.
__________________

Village Idiot is offline  
Reply With Quote
Old 12-15-2008, 10:54 PM   #4 (permalink)
The Contributor
 
Join Date: Oct 2008
Posts: 75
Thanks: 4
9three is on a distinguished road
Default

thanks for the feed back from both of you :)
9three is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
How to access the method of an object that is inside an object tony Advanced PHP Programming 5 11-13-2008 02:46 AM
Image gallery Tanax Advanced PHP Programming 2 10-30-2008 06:19 PM
Assigning non-static properties from a static method? delayedinsanity Advanced PHP Programming 4 07-10-2008 02:49 PM
Method to check Size of Remote File alex.zeal Tips & Tricks 4 09-22-2007 10:22 AM


All times are GMT. The time now is 10:56 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design