{"id":60909,"date":"2025-04-26T09:31:54","date_gmt":"2025-04-26T01:31:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60909\/"},"modified":"2025-04-26T09:31:54","modified_gmt":"2025-04-26T01:31:54","slug":"zencart%e6%89%b9%e9%87%8f%e5%88%a0%e9%99%a4%e6%97%a0%e5%9b%be%e7%89%87%e4%ba%a7%e5%93%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60909\/","title":{"rendered":"zencart\u6279\u91cf\u5220\u9664\u65e0\u56fe\u7247\u4ea7\u54c1"},"content":{"rendered":"<p> zencart\u6279\u91cf\u5220\u9664\u65e0\u56fe\u7247\u4ea7\u54c1\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u4fdd\u5b58\u4e3aremove_products.php\uff0c\u653e\u5230\u7f51\u7ad9\u6839\u76ee\u5f55\u8fd0\u884c\u5373\u53ef\uff0c\u64cd\u4f5c\u524d\u8bf7\u5148\u5907\u4efd\u6570\u636e\u5e93\u3002<\/p>\n<p>   &nbsp;  <\/p>\n<pre>\r\n&lt;?php   \r\nrequire('includes\/application_top.php');    \r\n$listing_sql = \"select * from \" .TABLE_PRODUCTS. \" \";   \r\n$listing = $db-&gt;Execute($listing_sql);   \r\nwhile (!$listing-&gt;EOF)\r\n{   \r\n    if(!file_exists(\"images\/\" . $listing-&gt;fields['products_image'])) \/\/\u5224\u65ad\u56fe\u7247\u662f\u5426\u5b58\u5728   \r\n    {   \r\n        $id= $listing-&gt;fields['products_id'];   \r\n        if ($id!=\"\")   \r\n        {   \r\n            \/\/\u5220\u9664\u6570\u636e\u5e93\u91cc\u8be5\u4ea7\u54c1\u7684\u6570\u636e\u3002 \u5220\u9664\u4e0d\u5b8c\u5168\uff0c\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u3002   \r\n            $p_sql = \"DELETE FROM \" .TABLE_PRODUCTS .\" WHERE products_id = $id\" ;    \r\n            $d_sql = \"DELETE FROM \" .TABLE_PRODUCTS_DESCRIPTION .\" WHERE products_id = $id\" ;    \r\n            $c_sql = \"DELETE FROM \" .TABLE_PRODUCTS_TO_CATEGORIES .\" WHERE products_id = $id\" ;    \r\n            $a_sql = \"DELETE FROM \" .TABLE_PRODUCTS_ATTRIBUTES .\" WHERE products_id = $id\" ;     \r\n            $db-&gt;Execute($p_sql);   \r\n            $db-&gt;Execute($d_sql);   \r\n            $db-&gt;Execute($c_sql);   \r\n            $db-&gt;Execute($a_sql);   \r\n            echo \"DEL ID $id  Product OK\".\"&lt;br \/&gt;\\r\\n\";   \r\n        }   \r\n    }   \r\n    $listing-&gt;MoveNext();   \r\n}   \r\n?&gt; <\/pre>\n<p>  &nbsp;   <\/p>\n<p> &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>zencart\u6279\u91cf\u5220\u9664\u65e0\u56fe\u7247\u4ea7\u54c1\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u4fdd\u5b58\u4e3aremove_products.php\uff0c\u653e\u5230\u7f51\u7ad9\u6839\u76ee\u5f55\u8fd0\u884c\u5373\u53ef\uff0c\u64cd\u4f5c\u524d\u8bf7\u5148\u5907\u4efd\u6570\u636e\u5e93\u3002 &nbsp; &lt;?php require(&#8216;includes\/application_top.php&#8217;); $listing_sql = &#8220;select * from &#8221; .TABLE_PRODUCTS. &#8221; &#8220;; $listing = $db-&gt;Execute($listing_sql); while (!$listing-&gt;EOF) { if(!file_exists(&#8220;images\/&#8221; . $listing-&gt;fields[&#8216;products_image&#8217;])) \/\/\u5224\u65ad\u56fe\u7247\u662f\u5426\u5b58\u5728 { $id= $listing-&gt;fields[&#8216;products_id&#8217;]; if ($id!=&#8221;&#8221;) { \/\/\u5220\u9664\u6570\u636e\u5e93\u91cc\u8be5\u4ea7\u54c1\u7684\u6570\u636e\u3002 \u5220\u9664\u4e0d\u5b8c\u5168\uff0c\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u3002 $p_sql = &#8220;DELETE FROM &#8221; .TABLE_PRODUCTS .&#8221; WHERE products_id = $id&#8221; ; $d_sql = &#8220;DELETE FROM &#8221; .TABLE_PRODUCTS_DESCRIPTION .&#8221; WHERE products_id = $id&#8221; ; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60909","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=60909"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60909\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}