Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how do i delete image from database

Featured Replies

I have a database that keeps the information of my group members. I have a script that can be used to delete any member's information from the database, but the member's image still remain in the upload folder of my website. how do i delete the member's information and his image from my database and upload folder.

 

regards

I have a database that keeps the information of my group members. I have a script that can be used to delete any member's information from the database, but the member's image still remain in the upload folder of my website. how do i delete the member's information and his image from my database and upload folder.

 

regards

Just use the unlink function in php

 

<?php
//File name and location to delete
$filetodelete = "filedirectory/filename.txt";

unlink($filetodelete);

?>

 

Please +1 me if this helped

Just out of interest, what is all this +1 stuff people tend to be requesting a lot lately?

 

They're begging for a credit for giving a useful answer (that little green button with a + at the bottom right); I don't really approve of begging, but it can't be stopped.

They're begging for a credit for giving a useful answer (that little green button with a + at the bottom right); I don't really approve of begging, but it can't be stopped.

 

Theres actually a difference between begging and just asking nicely saying please give me a +1 if this helped is just asking nicely for them to +1 you if your answer has helped not begging :aggressive:

  • 4 months later...

You'll need to use the PHP unlink function:

 

delete.php example:

 

 

example:

<?php

 

$id = ...

$query = mysqli_query("SELECT ..... WHERE id=$id");

unlink('./uploads/'.$query['file']);

mysqli_query("DELETE FROM ... WHERE id=$id");

.. redirect

 

off-topic..

The + button isn't hard to find, therefore I find it quite annoying when people append it to their post; I don't know, it just seems petty.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.