Jump to content

HELP! Showing images fom folder


angelali

Recommended Posts

I made an upload image system, the images are stored in a folder, while the image name is stored in database. When I try to execute the image name, it works successfully, but when I try to disply the image from the folder by using the image name in the database, I fail each time.

 

The folder where the images are being stored is named: saveimage

 

Here is the query:

 

<?php
mysql_connect('localhost', 'root', '') or die ('Connection Failed');
mysql_select_db('imagedatabase');
$images = mysql_query("SELECT * FROM img WHERE email='$lemail'");
while($row = mysql_fetch_array($images))
{
echo "<img src='saveimage/'".$row['img_description'];
}
?>

Link to comment
Share on other sites

Its working fine, I want the user to delete the images if he wants, do you know how to delete image in the folder? I mean, each image, I will insert a link something like that or a checkbox, if the user click on it, it deletes the respective image he has clicked... it will have to delete the respective row of the image in database as well..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.