More Loop Confusion
Posted: Sun Jun 25, 2006 7:35 pm
The code below will not execute...
The 'hello' portion of the code doesn't show..
Yet an echo of $deletefilelist[0] right before the loop echo's a zero.
Code: Select all
for($i=0; $i < 10 && $deletefilelist[$i] != ""; $i++) {
echo "hello";
$filetodelete=$deletefilelist[$i];
$deletesid=mysql_result($songdata,$filetodelete,"sid");
$deletefile=mysql_result($songdata,$filetodelete,"file");
$deletedir="./bands/songs/".$uid."/";
//Delete File
unlink($deletedir."/".$deletefile);
echo $deletedir."/".$deletefile."<br>";
//Remove from Song Database
$query="DELETE FROM `songs` WHERE `sid` = '".$deletesid."' LIMIT 1;";
echo $query;
mysql_query($query);
}Yet an echo of $deletefilelist[0] right before the loop echo's a zero.