Uploading image details from db with image from server

Hi,

i hope somebody can help me, i’m trying to build a website which displays my .jpg’s images stored on my server along with it’s information e.g image description stored on my mysql db together. I’ve got to the point where i can display my text successfully, however i don’t know how to display my .jpg’s along with my text.

I’ve been scouring the net for a good couple of hours tyring different search combinations, but so far i’ve only found tutorials where the image is stored on the db and is then uploaded with it’s corresponding text/info also stored on the db and is displayed on the browser.

My site does not have a form to upload images to the server as i am simply dragging and dropping the images directly into my server manually into my desired folders.

I’m not asking for code, but all i’m asking is for somebody to point me in the right direction to some good tutorials that will do what i want, essentailly upload image file from my server along with my text(info) to be displayed on my web page.

Please help if u can.

Are you saying upload the images to the server through the browser, or just display the images in the page?

It sounds like you already have a database; here is a simplified version for the sake of the example:

Image - id, description, filename

So you start with a form which allows you to upload the file, http://www.tizag.com/phpT/fileupload.php shows a pretty good tutorial.

Once you’ve sent the file to your server, the PHP script on the other end could start by saving description and filename to the database, the obtain the ID, which is auto-incrementing, and use that to store the image in images/$id/$filename

Later on when displaying the image, you could do something like:


<?php
foreach ($images as $image) {
'<img alt="" src=".../images/'.$image['id'].'/'.$image['filename'].'" />');
}

I hope that helps!

Dan Bernardic
<snip>
[URL=“http://dan.bernardic.ca”]