wahlhelfer/setup/importSQL.php
Klaus-Uwe Mitterer b384099d9b Restructuring a few things
Finally adding the setup files ._.
2016-02-07 23:16:32 +01:00

30 lines
No EOL
646 B
PHP
Executable file

<?php
include("helper.php");
$errors = array();
$goToNextStep = false;
$host = $_SESSION['db_host'];
$username = $_SESSION['db_user'];
$password = $_SESSION['db_pass'];
$database = $_SESSION['db_name'];
$con = mysql_connect($host, $username, $password);
mysql_select_db($database, $con);
$import = file_get_contents("config/import.sql");
$queries = array();
PMA_splitSqlFile($queries, $import);
foreach ($queries as $query)
{
if (!mysql_query($query['query']))
{
$errors[] = "<b>".mysql_error()."</b><br>(".substr($query['query'], 0, 200)."...)";
}
}
mysql_close($con);
include("templates/importSQL.php");