Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
Moderator: General Moderators
PastorHank
Forum Contributor
Posts: 117 Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country
Post
by PastorHank » Mon Mar 19, 2007 11:09 am
I'm getting ready to start retrieving images for use with my web app and I was wondering which method do folks think is more efficient.
Storing the path to an image in the database or storing the image itself in the database and then using the image datafield on a display form.
Thank you
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Mar 19, 2007 11:19 am
Path, hands down is more efficient.
Xoligy
Forum Commoner
Posts: 53 Joined: Sun Mar 04, 2007 5:35 am
Post
by Xoligy » Mon Mar 19, 2007 11:21 am
Browsers can cache paths, it won't slow down your database and many other advantages. You might want to use the database to store the meta information.
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Mon Mar 19, 2007 11:53 am
I like storing user content (images especially) as a file in the filesystem, named with the content's md5 hash. Meta data should be stored in the DB.
PastorHank
Forum Contributor
Posts: 117 Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country
Post
by PastorHank » Mon Mar 19, 2007 3:20 pm
Thank you for the input....using the path is working really well