我有一个包含数千个元素的数组。这是将其放入数据库的正确方法:
$connection = mysqli_connect($url, $usr, $pwd, $db) or die('<br><br>Error: ' . mysqli_error() . "<br><br>");
$stmt=mysqli_stmt_init($connection);
mysqli_stmt_prepare($stmt,"INSERT INTO Bible_KJV (verse) VALUES(?)");
$out .= "<br><hr><br>";
//Inserting the book in the database
for($i = 0;$i < count($lines);$i++) {
mysqli_stmt_bind_param($stmt,"s",$lines[$i]);
mysqli_stmt_execute($stmt);
$versenr = $i+1;
$out .= "Verse nr.: $versenr was inserted <br>";
}