Page 1 of 1

MySql or plain simple text file.

Posted: Tue Oct 27, 2009 1:16 pm
by yorkshireflatcap
All,

I've been recently reading that to store images onto a database is a no no..... it's best to load images directly from file.

If I follow the database route, then I need to create a simple program to read my images into the database - A bit of a hassle really.... especially if my website expands.

So what I've come up with is to create a type of file that is structured in such a way that I can read it using parse_ini_file. This file holds the names of images and I've created one for each directory - Calling it Thumbs.txt - plus any textual information associated with each image. It works fine, but just wondering if this is the correct approach to

Many thanks.

John

Re: MySql or plain simple text file.

Posted: Tue Oct 27, 2009 2:45 pm
by akuji36
Take a look at this link:

http://hockinson.com/index.php?s=37

Rod

Re: MySql or plain simple text file.

Posted: Tue Oct 27, 2009 6:33 pm
by califdon
What is normally done is to store the images in a directory in the web document root, then store the url to each image in the database. Then you can use the url in either an <a href=....> or an <img src=...> element in your web page. There's no need to store the images, themselves, in the database.