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
MySql or plain simple text file.
Moderator: General Moderators
-
yorkshireflatcap
- Forum Newbie
- Posts: 5
- Joined: Fri Oct 16, 2009 7:52 am
Re: MySql or plain simple text file.
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.