moonwalkercs wrote:I was thinking of doing it that way...but the images are uploaded by users. Is there a way to let a user upload a file to my webspace and then store the path to it?
Yes, there is. You need to use specific FORM method (multipart), and then fetch the file that gets stored in a temporary directory - which is handled by the server environment.
But, that has also some potential security risks, as your scripts would then have to have (public) write privilege. It depends on the server setup.
If you wish to do with database only, then to see the images you need to store their mimetype. Then write a script that will fetch the image BY ID, producing an output that has header set as mimetype of the image, followed by binary contents of the image file. For example:
<img src="image.php?id=12345" alt="Something" />
This was XML example. Omit the ending "/" for HTML 4.0. The image.php would then fetch the image from database, outputting the header and image binary, but NO HTML!
There is a short tutorial on how to handle both uploads and image fetching and display, in php documentation.