【发布时间】:2020-10-25 13:06:00
【问题描述】:
谢谢你的帮助,
我已经让 Webhooks 指向我的域我已经设法让一些字段写入我的数据库,但是我在将 line_items 及其数组的内容发布到 mysql 时遇到了问题。
例如,我想提取 line_items 的标题,即“飞行员太阳镜”
到目前为止,我只设法将单词 Array 拉到表中。
我用过这段代码
//Assign to variable
$email = $data['line_items???'];
$stmt = $link->query("INSERT INTO orders (test)
VALUES ('$email')");
这是数组的行项目部分
[line_items] => Array
(
[0] => Array
(
[id] => 487817672276298554
[variant_id] =>
[title] => Aviator sunglasses
[quantity] => 1
[sku] => SKU2006-001
[variant_title] =>
[vendor] =>
[fulfillment_service] => manual
[product_id] => 788032119674292922
[requires_shipping] => 1
[taxable] => 1
[gift_card] =>
[name] => Aviator sunglasses
[variant_inventory_management] =>
[properties] => Array
(
)
[product_exists] => 1
[fulfillable_quantity] => 1
[grams] => 100
[price] => 89.99
[total_discount] => 0.00
[fulfillment_status] =>
【问题讨论】: