this post could be made as well to the database forum,nonetheless I chose to make it here cause the solution may be related to php and not to the database.
I am making a blog and each blog article will have one image associated with,one big and one small.The small will be for previewing the article and the big when the article will be displayed fully to the user.
The imagepath of the small image will be stored in the database,but since we have 2 versions here of the same image, I assume there must be two columns storing the image path(one column for storing the image path of the small image and one column storing the image path of the big image)…unless there is another solution that is not db related.
If you use a naming convention you might be able to get away with storing the name once only. You could store your main image in the directory images and the smaller version in thumbs, for example, or name your images blogpost-xxx.jpg and blogpost-xxx-small.jpg.
Yes the one column would contain image.jpg and it would in fact be a variable containing the data pulled from the database. I know some forums leave off the extension as well. I assume they convert all image uploads to one file type.
True, but I was mentioning it purely based on the initial requirements - one image per post (if you tie the image name to the blog post id, it’s going to be unique)
Plus it won’t even need 1 column in the database, as it can be recognised by the ID or date or whatever. The down side being maybe a less descriptive filename.