目前我正在使用phpMyAdmin中的SQL从Magento表中删除信用卡号,其中包含
等命令更新
mg3u_sales_flat_order_payment
SET cc_number_enc = NULL
我想要一个PHP脚本,我可以执行而不是一直登录到phpMyAdmin。我曾尝试编写代码但不确定它是否可行。
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
require_once('app/Mage.php');
Mage::app();
$prefix=(string)Mage::getConfig()->getTablePrefix(); // Get Prefix
// fetch write database connection that is used in Mage_Core module
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
foreach ...
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("update " . $prefix . "sales_flat_quote_payment set cc_number_enc=null"); // Update Quote
$write->query("update " . $prefix . "sales_flat_order_payment set cc_number_enc=null"); // Update Order
}
echo "complete";