I’m relatively new and I’m programming this CMS. I already able to add, edit and remove pages with text that is stored in a MySQL database. Now, I want to be able to give the user the option of Inserting Images on the page.
How can I do this? I was looking at some forums and found this:
Should I store images in MySQL?
One word: No!
Storing images in a database is at least 10 times slower when retrieving than storing just a filename which then get’s delivered by the webserver.<BR> Ok, Step one: For every image, you’ll need an additional query. It will have to be read of the mysql server, transported to your webservers memory, pushed out to the user’s browser and then thrown away in your webserver memory. Repeat ad nausaum.
Now, if it’s stored as a file, it’s faster to begin with (no database queries, and filesystems are really really fast, nowadays), plus it will also be cached in your webservers memory if it’s asked for a lot making it as fast as the line will take it.
so, how can i upload images and then display them in the page dynamically?