{"id":60815,"date":"2025-04-26T11:14:34","date_gmt":"2025-04-26T03:14:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60815\/"},"modified":"2025-04-26T11:14:34","modified_gmt":"2025-04-26T03:14:34","slug":"zencart%e5%b8%b8%e7%94%a8sql%e5%91%bd%e4%bb%a4%e6%89%b9%e9%87%8f%e5%88%a0%e9%99%a4%e5%95%86%e5%93%81%e7%ad%89%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60815\/","title":{"rendered":"ZenCart\u5e38\u7528SQL\u547d\u4ee4\u6279\u91cf\u5220\u9664\u5546\u54c1\u7b49\u547d\u4ee4"},"content":{"rendered":"<p>\u4ee5\u4e0b\u662fZen-Cart\u7684\u9ad8\u7ea7\u7528\u6cd5\uff0c\u591a\u6570\u64cd\u4f5c\u53ef\u4ee5\u901a\u8fc7\u6279\u91cf\u4e0a\u4f20 (easy populate) \u548c \u5feb\u901f\u66f4\u65b0 \u6a21\u5757\u6765\u5b8c\u6210,   &nbsp;   \u4f46\u5728\u5e94\u7528\u4fbf\u6377\u6027\u548c\u4e00\u4e9b\u529f\u80fd\u6027\u7684\u8c03\u6574\u4e0a, \u603b\u6709\u4e00\u5b9a\u7684\u5c40\u9650\u6027;   &nbsp;   \u7f51\u7ad9\u7684\u5168\u90e8\u6570\u636e\u5747\u5b58\u653e\u5728\u6570\u636e\u5e93\u4e2d, \u6709\u4ec0\u4e48\u53d8\u66f4 \u76f4\u63a5\u64cd\u4f5c\u6570\u636e\u5e93\u65e0\u7591\u662f\u6700\u4fbf\u6377\u7684\u65b9\u5f0f,   &nbsp;   \u65e2\u7136\u8981\u52a8\u6570\u636e\u5e93, SQL\u8bed\u53e5\u662f\u80af\u5b9a\u79bb\u4e0d\u5f00\u4e86,   &nbsp;   \u65e5\u5e38\u8ddf\u7f51\u7ad9\u6253\u4ea4\u9053, \u8981\u63a5\u89e6\u719f\u6089\u5404\u79cd\u4ee3\u7801, \u8fd9\u91cc\u53c8\u591a\u4e86\u4e00\u79cd\u4ee3\u7801, \u6709\u70b9\u513f\u8ba9\u4eba\u5934\u5927,   &nbsp;   \u56e0\u6b64\u4e5f\u5c31\u4e86\u672c\u6587, \u4e0b\u9762\u4e3a\u65e5\u5e38\u5e94\u7528\u4e2d\u53ef\u80fd\u6d89\u53ca\u5230\u7684\u5e38\u7528\u7684\u6279\u91cf\u64cd\u4f5cSQL\u8bed\u53e5,   &nbsp;   \u53ef\u591a\u6761\u540c\u65f6\u6267\u884c \u4ea6\u53ef\u6309\u9700 \u6267\u884c\u5355\u6761\u547d\u4ee4; \u4e00\u6761\u5b8c\u6574\u7684SQL\u8bed\u53e5 \u4ee5 ; \u53f7\u7ed3\u675f.   &nbsp;   \u4e0b\u9762\u7684\u547d\u4ee4\u8bed\u53e5\u53ef\u4ee5\u901a\u8fc7 \u540e\u53f0 \u5de5\u5177 \u5b89\u88c5SQL\u811a\u672c \u63d0\u4ea4   &nbsp;   \u4e5f\u53ef\u4ee5\u76f4\u63a5\u590d\u5236\u7c98\u8d34\u5230 PHPMyadmin \u4e2d\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u4e2d\u7684 SQL \u9879\u4e2d \u6267\u884c\uff1a   &nbsp;   &nbsp;   &nbsp;   \u4e00 \u6279\u91cf\u5220\u9664\u5168\u90e8\u5546\u54c1\u7b49\u6570\u636e   &nbsp;   &nbsp;   # \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013   # \u529f\u80fd\uff1a\u6e05\u7a7aZen Cart\u4e2d\u6587\u72481.3.x\u7684\u6f14\u793a\u6570\u636e   # \u63d0\u9192\uff1a\u8bf7\u505a\u597d\u5907\u4efd !!!   # \u4f7f\u7528\uff1a\u7ba1\u7406\u9875\u9762 -&gt; \u5de5\u5177 -&gt; \u6267\u884cSQL\u811a\u672c   #   # Zen Cart \u4e2d\u6587\u535a\u5ba2   # http:\/\/zcbk.org   # \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013   &nbsp;   \u4ee3\u7801:   # \u6e05\u7a7a\u5546\u54c1\u5206\u7c7b\u3001\u5546\u54c1\u3001\u5c5e\u6027   TRUNCATE TABLE categories;   TRUNCATE TABLE categories_description;   &nbsp;   # \u6e05\u7a7a\u5546\u54c1\u4ee5\u53ca\u5c5e\u6027   TRUNCATE TABLE media_clips;   TRUNCATE TABLE media_manager;   TRUNCATE TABLE media_to_products;   TRUNCATE TABLE media_types;   TRUNCATE TABLE music_genre;   TRUNCATE TABLE product_music_extra;   TRUNCATE TABLE product_types_to_category;   TRUNCATE TABLE products;   TRUNCATE TABLE products_attributes;   TRUNCATE TABLE products_attributes_download;   TRUNCATE TABLE products_description;   TRUNCATE TABLE products_discount_quantity;   TRUNCATE TABLE products_notifications;   TRUNCATE TABLE products_options;   TRUNCATE TABLE products_to_categories;   TRUNCATE TABLE record_artists;   TRUNCATE TABLE record_artists_info;   TRUNCATE TABLE record_company;   TRUNCATE TABLE record_company_info;   &nbsp;   # \u6e05\u7a7a\u63a8\u8350\u5546\u54c1   TRUNCATE TABLE featured;   &nbsp;   # \u6e05\u7a7a\u4fc3\u9500\u5546\u54c1   TRUNCATE TABLE salemaker_sales;   &nbsp;   # \u6e05\u7a7a\u7279\u4ef7\u5546\u54c1   TRUNCATE TABLE specials;   &nbsp;   # \u6e05\u7a7a\u56e2\u4f53\u4ef7\u683c   TRUNCATE TABLE group_pricing;   &nbsp;   # \u6e05\u7a7a\u5382\u5bb6\u53ca\u8d44\u6599   TRUNCATE TABLE manufacturers;   TRUNCATE TABLE manufacturers_info;   &nbsp;   # \u6e05\u7a7a\u5ba2\u6237\u8bc4\u8bba   TRUNCATE TABLE reviews;   TRUNCATE TABLE reviews_description;   &nbsp;   #\u6e05\u7a7a\u524d\u53f0\u6ce8\u518c\u7528\u6237 \u8ba2\u5355 \u5386\u53f2\u8ba2\u5355\u7b49\u4fe1\u606f \u614e\u7528   TRUNCATE TABLE `address_book`;   TRUNCATE TABLE `admin_activity_log`;   TRUNCATE TABLE `counter`;   TRUNCATE TABLE `counter_history`;   TRUNCATE TABLE `customers`;   TRUNCATE TABLE `customers_basket`;   TRUNCATE TABLE `customers_info`;   TRUNCATE TABLE `orders`;   TRUNCATE TABLE `orders_products`;   TRUNCATE TABLE `orders_status_history`;   TRUNCATE TABLE `orders_total`;   TRUNCATE TABLE `paypal`;   TRUNCATE TABLE `paypal_payment_status_history`;   TRUNCATE TABLE `paypal_session`;   update `products_description` set `products_viewed` = &#8216;0&#8217; WHERE `products_viewed` &gt; &#8216;0&#8217;;   update `products` set `products_ordered` = &#8216;0&#8217; WHERE `products_ordered` &gt; &#8216;0&#8217;;   \u4e8c \u6279\u91cf\u589e\u52a0\u5404\u5e38\u7528\u9879\u6570\u636e\u5b57\u6bb5   &nbsp;   &nbsp;   &nbsp;#=====================================================================   &nbsp;# @ \u589e\u5927 Zen Cart \u6570\u636e\u5e93\u5b57\u6bb5   &nbsp;#&nbsp;   &nbsp;# @ \u4f7f\u7528\u65b9\u6cd5: (\u4e0b\u9762\u4e09\u79cd\u5bfc\u5165\u65b9\u5f0f \u4efb\u9009\u5176\u4e00 \u4e0d\u5fc5\u91cd\u590d\u64cd\u4f5c)   &nbsp;# @ \u4e00 \u590d\u5236\u672c\u6587\u4ef6\u4ee3\u7801, \u7c98\u8d34\u5165Zen Cart \u540e\u53f0 &#8211;&gt; \u5de5\u5177 &#8211;&gt; SQL\u5b89\u88c5 \u9879\u4e2d \u63d0\u4ea4 \u6216 \u5728\u5176\u7684 \u6d4f\u89c8\u6587\u4ef6\u4e2d \u627e\u5230\u672c\u6587\u4ef6 \u76f4\u63a5\u63d0\u4ea4\u5bfc\u5165&nbsp;   &nbsp;# @ \u4e8c \u76f4\u63a5\u5728 PHPMyadmin\u4e2d \u7684 \u5f53\u524d\u6570\u636e\u5e93\u4e2d\u7684 SQL\u9879 \u7c98\u8d34\u672c\u6587\u4ef6\u4ee3\u7801, \u6267\u884c\u5373\u53ef   &nbsp;# @ \u4e09 \u5728 PHPMyadmin &nbsp;\u4e2d\u7684\u5f53\u524d\u6570\u636e\u4e2d \u70b9\u51fb\u5bfc\u5165\u9879 \u5e76\u5bfc\u5165\u672c\u6587\u4ef6 \u6267\u884c\u5373\u53ef   &nbsp;#   &nbsp;# @ By KIRA   &nbsp;# @ QQ: 6171718   &nbsp;# @ Email: kira@kpa7.net   &nbsp;# @ Blog: http:\/\/zcbk.org   &nbsp;#=====================================================================   ALTER TABLE categories MODIFY categories_image varchar(255) ;   ALTER TABLE categories_description MODIFY categories_name varchar(255) ;   ALTER TABLE products MODIFY products_model varchar(255) ;   ALTER TABLE products MODIFY products_image varchar(255) ;   ALTER TABLE products_description MODIFY products_name varchar(255) ;   ALTER TABLE address_book MODIFY entry_firstname varchar(255) ;   ALTER TABLE address_book MODIFY entry_lastname varchar(255) ;   ALTER TABLE categories_description MODIFY categories_name varchar(255) ;   ALTER TABLE configuration_group MODIFY configuration_group_title varchar(255) ;   ALTER TABLE customers_wishlist MODIFY products_name varchar(255) ;   ALTER TABLE customers_wishlist MODIFY wishlist_name varchar(255) ;   ALTER TABLE files_uploaded MODIFY files_uploaded_name varchar(255) ;   ALTER TABLE orders MODIFY customers_name varchar(255) ;   ALTER TABLE orders MODIFY customers_email_address varchar(255) ;   ALTER TABLE orders MODIFY delivery_name varchar(255) ;   ALTER TABLE orders MODIFY billing_name varchar(255) ;   ALTER TABLE orders MODIFY cc_owner varchar(255) ;   ALTER TABLE orders_products MODIFY products_name varchar(255) ;   ALTER TABLE orders_products MODIFY products_model varchar(255) ;   ALTER TABLE address_book MODIFY entry_street_address varchar(255) ;   \u4e09\u6279\u91cf\u53d8\u66f4\u5546\u54c1\u90e8\u5206\u5c5e\u6027   &nbsp;   &nbsp;   &nbsp;#==========================   &nbsp;# @ Zen Cart \u4e2d\u6587\u535a\u5ba2   &nbsp;# @ By KIRA   &nbsp;# @ QQ: 6171718   &nbsp;# @ Email: kira@kpa7.net   &nbsp;# @ Blog: http:\/\/zcbk.org   &nbsp;#==========================   &nbsp;   &nbsp;#\u6279\u91cf\u8bbe\u7f6e\u7279\u4ef7\u5546\u54c1\u8d77\u59cb\u65f6\u95f4, \u5176\u4e2d 0001-01-01 \u4e3a \u65e0\u8d77\u59cb\u65f6\u95f4   UPDATE specials SET specials_date_available =&#8217;0001-01-01&#8242;;   &nbsp;   #\u6279\u91cf\u8bbe\u7f6e\u7279\u4ef7\u5546\u54c1\u5230\u671f\u65f6\u95f4 \u5176\u4e2d 2020-12-31 \u4e3a\u5230\u671f\u65f6\u95f4   UPDATE specials SET expires_date =&#8217;2020-12-31&#8242;;   &nbsp;   #\u6279\u91cf\u5f00\u542f\u7279\u4ef7\u5546\u54c1   UPDATE specials SET status =&#8217;1&#8242;;   &nbsp;   #\u6279\u91cf\u5173\u95ed\u7279\u4ef7\u5546\u54c1   UPDATE specials SET status =&#8217;0&#8242;;   &nbsp;   #\u6279\u91cf\u8bbe\u7f6e\u5168\u7ad9\u5546\u54c1\u514d\u8fd0\u8d39   UPDATE products SET product_is_always_free_shipping = &#8216;1&#8217;;&nbsp;   &nbsp;   #\u6279\u91cf\u66f4\u6539\u5546\u54c1\u6dfb\u52a0\u65f6\u95f4 \u5176\u4e2d 2011-10-01 \u4e3a\u6dfb\u52a0\u65f6\u671f   UPDATE products SET products_date_added = &#8216;2011-10-01&#8217;;&nbsp;   &nbsp;   #\u6279\u91cf\u66f4\u6539\u5546\u54c1\u91cd\u91cf \u5176\u4e2d 500 \u4e3a\u91cd\u91cf\u503c   UPDATE products SET products_weight = &#8216;500&#8217;;&nbsp;   &nbsp;   #\u6279\u91cf\u8bbe\u7f6e\u5e93\u5b58\u6570\u91cf \u5176\u4e2d 99 \u4e3a\u5e93\u5b58\u6570\u91cf   UPDATE `products` SET `products_quantity` = &#8217;99&#8217;;   &nbsp;   #\u6279\u91cf\u8bbe\u7f6e\u7279\u4ef7\uff0c\u5176\u4e2d +11.55 \u6307\u7684\u662f\u589e\u52a0 11.55\uff0c\u5982\u679c\u662f\u51cf\u5c11\u5c31\u662f -11.55   UPDATE specials SET specials_new_products_price=specials_new_products_price+11.55;   UPDATE products p,specials s SET p.products_price_sorter = s.specials_new_products_price WHERE p.products_id = s.products_id;   &nbsp;   #\u6279\u91cf\u8bbe\u7f6e\u539f\u4ef7\uff0c\u5176\u4e2d +22.66 \u6307\u7684\u662f\u589e\u52a0 22.66\uff0c\u5982\u679c\u662f\u51cf\u5c11\u5c31\u662f -22.66   UPDATE `products` SET `products_price`=`products_price`+22.66;   &nbsp;   #\u6279\u91cf\u66ff\u6362\u5546\u54c1\u63cf\u8ff0\u6307\u5b9a\u5b57\u7b26   update products_description set products_description=replace(products_description,&#8217;\u8fd9\u91cc\u8f93\u5165\u8981\u67e5\u627e\u7684\u5b57\u7b26&#8217;,&#8217;\u8fd9\u91cc\u8f93\u5165\u8981\u66ff\u6362\u7684\u5b57\u7b26&#8217;)&nbsp;   &nbsp;   #\u6279\u91cf\u914d\u7f6e\u56fe\u50cf\u53c2\u6570   update configuration set configuration_value=replace(configuration_value,&#8217;\u539f\u56fe\u50cf\u5bbd\u6216\u9ad8&#8217;,&#8217;\u60f3\u8981\u4fee\u6539\u7684\u56fe\u50cf\u5bbd\u6216\u9ad8&#8217;);   &nbsp;   #\u6309\u9009\u9879\u5173\u5065\u5b57\u6bb5\u66f4\u65b0\u914d\u7f6e   UPDATE `configuration` SET `configuration_value` = &#8216;\u66f4\u65b0\u503c&#8217; WHERE `configuration`.`configuration_key` = &#8216;\u914d\u7f6e\u9879\u5173\u5065\u5b57\u6bb5&#8217;;   &nbsp;   #\u6309\u9009\u9879\u6807\u9898\u66f4\u65b0\u5177\u4f53\u914d\u7f6e   UPDATE `configuration` SET `configuration_value` = &#8216;\u66f4\u65b0\u503c&#8217; WHERE `configuration`.`configuration_title` = &#8216;\u914d\u7f6e\u9879\u6807\u9898&#8217;;   \u518d\u8865\u5145\u4e00\u4e2a \u4fee\u590d \u56e0\u4f7f\u7528\u6279\u91cf\u5220\u9664\u5bfc\u81f4\u7684\u540e\u53f0\u6dfb\u52a0\u5546\u54c1\u5c5e\u6027\u4e0b\u62c9\u9009\u62e9\u7a7a\u767d\u7684SQL   \u8be6\u60c5\u53ef\u4ee5\u53c2\u89c1: \u89e3\u51b3 Zen cart \u540e\u53f0\u5c5e\u6027\u9009\u9879\u540d\u79f0\u4e0b\u62c9\u7a7a\u767d\u95ee\u9898   &nbsp;   &nbsp;   &nbsp;#==========================   &nbsp;# @ Zen Cart \u4e2d\u6587\u535a\u5ba2   &nbsp;# @ By KIRA   &nbsp;# @ QQ: 6171718   &nbsp;# @ Email: kira@kpa7.net   &nbsp;# @ Blog: http:\/\/zcbk.org   &nbsp;#==========================   INSERT INTO `products_options_types` VALUES (0, &#8216;\u4e0b\u62c9&#8217;);   INSERT INTO `products_options_types` VALUES (1, &#8216;\u6587\u672c&#8217;);   INSERT INTO `products_options_types` VALUES (2, &#8216;\u5355\u9009&#8217;);   INSERT INTO `products_options_types` VALUES (3, &#8216;\u591a\u9009&#8217;);   INSERT INTO `products_options_types` VALUES (4, &#8216;\u6587\u4ef6&#8217;);   INSERT INTO `products_options_types` VALUES (5, &#8216;\u53ea\u8bfb&#8217;);   INSERT INTO `products_options_values` (products_options_values_id,language_id,products_options_values_name,products_options_values_sort_order) VALUES (0,1,&#8217;TEXT&#8217;,0);   &nbsp;  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u662fZen-Cart\u7684\u9ad8\u7ea7\u7528\u6cd5\uff0c\u591a\u6570\u64cd\u4f5c\u53ef\u4ee5\u901a\u8fc7\u6279\u91cf\u4e0a\u4f20 (easy populate) \u548c \u5feb\u901f\u66f4\u65b0 \u6a21\u5757\u6765\u5b8c\u6210, &nbsp; \u4f46\u5728\u5e94\u7528\u4fbf\u6377\u6027\u548c\u4e00\u4e9b\u529f\u80fd\u6027\u7684\u8c03\u6574\u4e0a, \u603b\u6709\u4e00\u5b9a\u7684\u5c40\u9650\u6027; &nbsp; \u7f51\u7ad9\u7684\u5168\u90e8\u6570\u636e\u5747\u5b58\u653e\u5728\u6570\u636e\u5e93\u4e2d, \u6709\u4ec0\u4e48\u53d8\u66f4 \u76f4\u63a5\u64cd\u4f5c\u6570\u636e\u5e93\u65e0\u7591\u662f\u6700\u4fbf\u6377\u7684\u65b9\u5f0f, &nbsp; \u65e2\u7136\u8981\u52a8\u6570\u636e\u5e93, SQL\u8bed\u53e5\u662f\u80af\u5b9a\u79bb\u4e0d\u5f00\u4e86, &nbsp; \u65e5\u5e38\u8ddf\u7f51\u7ad9\u6253\u4ea4\u9053, \u8981\u63a5\u89e6\u719f\u6089\u5404\u79cd\u4ee3\u7801, \u8fd9\u91cc\u53c8\u591a\u4e86\u4e00\u79cd\u4ee3\u7801, \u6709\u70b9\u513f\u8ba9\u4eba\u5934\u5927, &nbsp; \u56e0\u6b64\u4e5f\u5c31\u4e86\u672c\u6587, \u4e0b\u9762\u4e3a\u65e5\u5e38\u5e94\u7528\u4e2d\u53ef\u80fd\u6d89\u53ca\u5230\u7684\u5e38\u7528\u7684\u6279\u91cf\u64cd\u4f5cSQL\u8bed\u53e5, &nbsp; \u53ef\u591a\u6761\u540c\u65f6\u6267\u884c \u4ea6\u53ef\u6309\u9700 \u6267\u884c\u5355\u6761\u547d\u4ee4; \u4e00\u6761\u5b8c\u6574\u7684SQL\u8bed\u53e5 \u4ee5 ; \u53f7\u7ed3\u675f. &nbsp; \u4e0b\u9762\u7684\u547d\u4ee4\u8bed\u53e5\u53ef\u4ee5\u901a\u8fc7 \u540e\u53f0 \u5de5\u5177 \u5b89\u88c5SQL\u811a\u672c \u63d0\u4ea4 &nbsp; \u4e5f\u53ef\u4ee5\u76f4\u63a5\u590d\u5236\u7c98\u8d34\u5230 PHPMyadmin \u4e2d\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u4e2d\u7684 SQL \u9879\u4e2d \u6267\u884c\uff1a &nbsp; &nbsp; &nbsp; \u4e00 \u6279\u91cf\u5220\u9664\u5168\u90e8\u5546\u54c1\u7b49\u6570\u636e &nbsp; &nbsp; # \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013 # [&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-60815","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60815","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=60815"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60815\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}