Hi all,
I'm currently using the following:
foreach ($_POST['delete_article_id'] as $k=>$v) {
$query_attachments = mysql_query("SELECT knowledge_upload_path FROM knowledgebase_uploads WHERE knowledge_article_id = '$v'");
while($row = mysql_fetch_array($query_attachments)){
$knowledge_upload_path = $row['knowledge_upload_path'];
$file = "C:/phpdev/www/cartgurus/admin/kb_uploads/$knowledge_upload_path";
echo "$file<br>";
unlink("$file");
}
}
Can anyone see where i might be going wrong? I get the following error:
C:/phpdev/www/cartgurus/admin/kb_uploads/image1.jpg
Warning: unlink() failed (No such file or directory) in c:\phpdev\www\cartgurus\admin\admin_knowledgebase.php on line 23
C:/phpdev/www/cartgurus/admin/kb_uploads/image2.jpg
Warning: unlink() failed (No such file or directory) in c:\phpdev\www\cartgurus\admin\admin_knowledgebase.php on line 23
When i echo $file i get the correct output....eg.
C:/phpdev/www/cartgurus/admin/kb_uploads/image1.jpg
C:/phpdev/www/cartgurus/admin/kb_uploads/image2.jpg
Any ideas?
Cheers,
micmac