1
我從我正在處理的表單中獲得以下轉儲,並且需要將數據插入到MySQL中。我的問題是我有點困惑,應該如何處理表單中的數據(如何做foreach或找到更好的方法來處理它)。從表單提交多維數組提交,我需要獲取數據並將其插入到mysql
轉儲:
array(4)
[
"product_name_" => array(2)
[
0 => string(10) "top hartie"
2 => string(7) "pix gel"
]
"quantity_" => array(2)
[
0 => string(1) "2"
2 => string(1) "3"
]
"price_" => array(2)
[
0 => string(3) "200"
2 => string(2) "10"
]
"Submit" => string(6) "Submit"
]
** 1)**考慮SQL查詢(它看起來像什麼)或者只是把它寫下來** 2)考慮如何使用PHP進行查詢** 3)代碼 – HamZa
INSERT INTO'invoice'('productName','quantity','price')VALUES(:productName,:quantity,:price)xD – Bogdan
我在想什麼是使用3 foreach-uri來處理來自窗體的數據。 – Bogdan