Jump to content


Photo

PHP and deleting files


  • Please log in to reply
1 reply to this topic

#1 Jurik

Jurik
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 05 October 2006 - 08:24 AM

Hi guys, im running a bit of code that is to be designed to delete entrys from a MYSQL database as well as the file which is stored in a folder known as videos, well I got the code deleting the entry in the database but it is not delete the file in the folder, any ideas on how I go about doing this? Heres the code im using

<?php

if (isset($_GET['ID'])) {
$vidID = $_GET['ID'];
} else {
$vidID = NULL;
}

$query = "DELETE FROM videos WHERE ID = ('$vidID')";

$result = mysql_query($query);

echo "The video has been deleted.";

?>


Any help would be great

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 05 October 2006 - 08:38 AM

you could use unlink to delete the files.

Good Luck,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users