怎麼把對應資訊下的所有圖片全部刪除?小弟My Code只刪除一張圖片。

來源:互聯網
上載者:User
如何把對應資訊下的所有圖片全部刪除?My Code只刪除一張圖片。。。
代碼運行後只刪除檔案夾裡的一張圖片,怎麼做到把對應資訊下的圖片全部刪除呢?


include("config.inc.php");
include("function.php");
include("in.php");
if($_COOKIE['fcw_ly']=='企業') header("location:out.php");
$conn=mysql_connect($YIHOST,$YIUSER,$YIPASS);
mysql_query("set names gbk");
mysql_select_db($YINAME);
if (empty($_GET['id']))
{
mysql_close();
echo "";
exit;
}
$YID=htmlencode2($_GET['id']);


$sql="select YDT,YXT from ytp where YZM=$yimaoid and YLX='房源' and YYH=$YHID and YBH=$YID";
$r=mysql_query($sql);
$row=mysql_fetch_assoc($r);
foreach($row as $v) unlink($v);


$exec="delete from yfy where YZM=$yimaoid and YYH=$YHID and YID=$YID";
mysql_query($exec);

$exec="delete from ytp where YZM=$yimaoid and YLX='房源' and YYH=$YHID and YBH=$YID";
mysql_query($exec);
mysql_close();
echo "";
exit;
?>

------解決方案--------------------
都是你自己的方法。只有你自己知道。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.