Calling images from a database and assigning them a url
Posted 02 October 2006 - 12:20 AM
Posted 02 October 2006 - 12:47 AM
If your still inclined to use the database, then you will need to make a image script that reads the $_GET request (/image.php?image=999) and fetches the image from the database and then dumps it to the browser using a set of header functions!
Posted 02 October 2006 - 12:50 AM
So when the user uploads the pic, I should have php save it in a directory on my server? Not sure how to do that... I'll have to research that.
What is the reason behind no images in databases? I'm a little new to this, so not on the same page with a lot of things just yet.
Posted 02 October 2006 - 01:18 AM
What is the reason behind no images in databases?
Like with anything you do, you try your best to do it using the most logical, resource friendly way. When you store a image in the database, and serve it dynamically, you have to use (2) queries just to serve that image.'
1. get the (id) to load into the image tag
2. call the image script that runs the query to fetch the image!
The other way, you run (1) query, the server can then pass the image information to the browser (last modified). If the user has already seen the image and it is still in the browser cache, then the server doesn't have to send it again, so it becomes very resource friendly compared to you having to control the process!
Posted 02 October 2006 - 03:02 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users