hi all
i am working on a website that will display projects and many images for each project.
i want to make an interface for the website admin to login and add new projects and images for each project.
i was wondering whats the best way to store the images in the mysql database and assign them to a project an then display the project with a slideshow next to it that shows all images for this specific project.
i decided to make 2 tables, one for projects (projID projName and projDesc) and the other for images (imgID imgName projID)
in the imgName field i will store the image name, and in the php code i will display the path which is always the same and get the image name from the database.
is everything i said make sense so far?
i know how to upload an image and attach it and send it as an email
but i dont know how to upload the image to the directory, and store the name of the image in the database in imgName field to retrieve it later with php
if you know any tutorial or article or sample code please help...
thanks a lot

i sent the upload code here... check ma posts

hi all
i am working on a website that will display projects and many images for each project.
i want to make an interface for the website admin to login and add new projects and images for each project.
i was wondering whats the best way to store the images in the mysql database and assign them to a project an then display the project with a slideshow next to it that shows all images for this specific project.
i decided to make 2 tables, one for projects (projID projName and projDesc) and the other for images (imgID imgName projID)
in the imgName field i will store the image name, and in the php code i will display the path which is always the same and get the image name from the database.
is everything i said make sense so far?
i know how to upload an image and attach it and send it as an email
but i dont know how to upload the image to the directory, and store the name of the image in the database in imgName field to retrieve it later with php
if you know any tutorial or article or sample code please help...
thanks a lot

---------------------------------------------------------------------------------
make a folder in ur directory........and change the folder name frm the below code.......i think it will help you....

/*image upload*/
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES);
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES);

if(move_uploaded_file($_FILES, $target_path)) {
echo "The file ". basename( $_FILES).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}

hai,
i didn't get the source code of "how to display the uploaded images to the same page."
Please help me to solve the problem

This article has been dead for over six months. Start a new discussion instead.