Unlink problem

I have a image rotate system. but this script needs to delete the picture from folder and database been working on it but i can’t get it to work

[php]$checkbox = $_POST[‘checkbox’];
$delete = $_POST[‘delete’];
for($i=0;$i<$count;$i++){
$del_id = $checkbox[$i];
$sql = “DELETE FROM $tbl_naam WHERE ID=’$del_id’”;
$sql1 = “SELECT ID,locatie FROM $tbl_naam WHERE ID=’$checkbox[$i]’”;
$rslt = mysql_query($sql1);
unlink ($rslt);
$result = mysql_query($sql);
}[/php]

this is the code to delete it, i’m not good with for loops please help:)

You have to tell it where the file is.
unlink("/images/ads/".$filename);

Why are you deleting the record, then running a query to find the record you just deleted? unlink() deletes a physical file on the server.

and change the for loop to
for($i=0; $i < count($_POST[‘checkbox’]); $++)

Sponsor our Newsletter | Privacy Policy | Terms of Service