PHP Classes

File: OLD_VERSION/example.php

Recommend this page to a friend!
  Classes of David Castillo   MySQL importer   OLD_VERSION/example.php   Download  
File: OLD_VERSION/example.php
Role: Example script
Content type: text/plain
Description: OLD Example of usage
Class: MySQL importer
Execute SQL statements from MySQL dump files
Author: By
Last change: Name changed
Date: 15 years ago
Size: 750 bytes
 

Contents

Class file image Download
<?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";
    }
}

?>