Login   Register  
PHP Classes
elePHPant
Icontem

File: sqlImportExample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ruben Crespo  >  SQL Import  >  sqlImportExample.php  >  Download  
File: sqlImportExample.php
Role: Example script
Content type: text/plain
Description: Example
Class: SQL Import
Execute MySQL queries imported from a file
Author: By
Last change:
Date: 5 years ago
Size: 595 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["exito"] == 1)
{
echo 
"Felicidades !!!. La instalación se ha completado con éxito";
} else {
echo 
$import ["errorCode"].": ".$import ["errorText"];
}

?>