Location: PHPKode > scripts > MySQL importer > mysql-importer/example.php
<?php
include ("ClassSQLimport.php");
/*
$host = "yourDBHost";
$dbUser = "youuser";
$dbPassword = "yourpass";
$sqlFile = "yourSqlFile.sql";
*/

$host = "localhost";
$dbUser = "root";
$dbPassword = "";
$sqlFile = "SQLTest.sql";

$newImport = new sqlImport ($host, $dbUser, $dbPassword, $sqlFile);
$newImport->import();
//------------------ Show Messages !!! ---------------------------
$import = $newImport -> ShowErr ();
if ($import[0] == true)
{
echo "Congratulations! The file: $sqlFile has been imported successfully";
} else {
	echo "Ops! The file: $sqlFile had errors during the importing...<br>\r\n";
	foreach($import[1] as $index => $value){
		echo $import [1][$index].": ".$import [2][$index]."<br>\r\n";
	}
}

?> 
Return current item: MySQL importer