I'm beginner programming. I try to insert array value into mysql table.
here is my array:
$responseArray=Array
(
[0] => Array
(
[code] => 9BP3
[name] => 9Bp No3
)
[1] => Array
(
[code] => AA
[name] => Ataria
)
[2] => Array
(
[code] => AABH
[name] => Ambika Bhawani Halt
)
[3] => Array
(
[code] => AADR
[name] => Amb Andaura
)
[4] => Array
(
[code] => AAG
[name] => Angar
)
[5] => Array
(
[code] => AAH
[name] => Itehar
)
)
and here is mysql table structure:
id, code, name
How to insert array into this table using loop?
and If in database table row differ from array count then it will truncate table and insert array.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…