-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
        )
)
nitroox88ks
  • 43
  • 1
  • 6

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
  • 93,638
  • 21
  • 103
  • 149