<?php
/*
Bare bones, no extra connection or result checking, tried to mostly stick with the code example from php.net/mysqli_stmt_prepare() \
*/

global $link;

//$link = mysqli_connect("localhost", "my_user", "my_password", "world");

$link mysqli_connect("localhost""root""r00tz00","test");


function 
DoInsert($stmt) { // Interested this function's "own execution time"
    
global $link;

    
$foo "abcd";
    
$dummy1 "efgh";
    
$dummy2 "01010101000";
    
$dummy3 "mnop";
    
mysqli_stmt_bind_param($stmt"ssss"$foo$dummy1$dummy2$dummy3);
    
mysqli_stmt_execute($stmt);
}

$stmt mysqli_prepare($link,"INSERT INTO `BENCHMARK` (FOO,DUMMY1,DUMMY2,DUMMY3) VALUES (?,?,?,?)");
/* Insert 100,000 rows */
for ($i=0;$i<1000000;$i++) {
        
DoInsert($stmt);
}

mysqli_query("TRUNCATE TABLE `BENCHMARK`",$link);

?>