BESTAND VOLGOOIEN
<?php

# start speedtest
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime; 

# delete file and make new one
$file = "SQLdump.txt";
if ( file_exists($file) ) unlink($file);
$fp = fopen($file, "a");
#add random data
for ( $i = 1111111111; $i <= 1211111111; $i++ )
{
	fputs($fp, $i. ',' .rand(100000000000, 256000000000). ',' .time(). ',' .rand(0,9). '
');
}

fclose($fp);

# end speedtest
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "This page was created in ".$totaltime." seconds";
?>



MYSQL DUMP
<?php

# start speetest
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime; 

# connect to database
mysql_connect("localhost", "***", "***") or die(mysql_error());
mysql_select_db("***") or die(mysql_error());

# the database query, don't forget the absolute path to the TXT file
mysql_query(
"
LOAD DATA INFILE 'C:/htdocs/SQLdump.txt'
    INTO TABLE tabel
    FIELDS
       TERMINATED BY ','
"
) or die(mysql_error());

# end speedtest
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "This page was created in ".$totaltime." seconds";

?>



POSTGRESQL DUMP
<?php

# start speetest
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime; 

# connect to database
$conn_string = "host=localhost port=5432 dbname=DB user=USER password=PASSWORD";
$db = pg_connect($conn_string) or die(pg_last_error());

# the database query, don't forget the absolute path to the TXT file
pg_query($db,
"
COPY trans FROM 'C:/htdocs/SQLdump.txt'
      WITH
	   DELIMITER  ','
"
) or die(pg_last_error()); 

# end speedtest
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "This page was created in ".$totaltime." seconds";

?>