11 INSERT Meerdere Rijen invoegen

$newUsers = [
[ 'jan', 'jan@mail.com' ],
[ 'carlo', 'carlo@mail.com' ],
[ 'vincent', 'vincent@mail.com' ]
];

$stmt = $mysqli -> prepare(‘INSERT INTO users (name, email) VALUES (?,?)’);

foreach ($newUsers as $user) {

$name = $user[0];
$email = $user[1];

$stmt -> bind_param(‘ss’, $name, $email);
$stmt -> execute();

echo “{$name}’s account id is {$stmt -> insert_id}”;

}