-4

I am sorry but I am stuck at the moment.

How can I read the individual values of this array ? With foreach?

Array
(
    [30706] => Array
        (
            [name] => 30706
            [model] => al553
        )
)

1 Answers1

0

Assuming you connect using PDO

$sql = 'INSERT into table (`name`, `model`) VALUES(:name, :model)';
$stmt = $db->prepare($sql);

foreach ($arr as $data) {
    $stmt->execute([':name' => $data['name'], ':model' => $data['model']])        
}
RiggsFolly
  • 89,708
  • 20
  • 100
  • 143