July 25th, 2000, 04:45 AM
I'm going to start a news-system. I planned the database, but I'm not sure how to place the images into a generated form.
The database (partial) is:
title varchar (50)
body varchar --> here comes the html source
It is a good way to place the image path into the html (img src...) and store the images in a specified directory, or easier to place the binary file into the database (pgsql)??
Can somebody help me which is the best?
And what is better for the body, the article in a html file, and in the database only the link or the html source in the database.
July 25th, 2000, 06:43 AM
It seems daft to me to place the image in the database itself - although many people do.
I just store a reference to the image either by creating a field specifically for this purpose , or even better naming the image after the id of the db record, ie if a record has a unique id of 30 , then the image that relates to that record is stored as 30.jpg etc.
Just seems faster than pulling an image out of the database itself.