-1
我不明白什麼是錯的這陣,爲什麼它不工作,當任何其他時候它的工作...PHP插入值錯誤
它的簡單,我做一個foreach循環和值插入到一個數組:
$insert = [];
foreach ($csv as $i=>$row) {
$insert[$i] = [
'id_customer' => $row[0],
'id_shop_group' => $row[1],
`id_shop` => $row[2],
];
}
的陣列產生的是:
0 =>
array (size=3)
'id_customer' => string '14' (length=2)
'id_shop_group' => string '1' (length=1)
'' => string '1' (length=1)
我不明白......我創造我自己的鑰匙,它應該被添加到陣列中,但它不是......是什麼問題?
您對'id_shop'使用'''',而不是像'id_customer'和'id_shop_group'那樣使用''''。 – Albzi