31 lines
710 B
PHP
31 lines
710 B
PHP
|
<?php
|
||
|
|
||
|
include("./connection.php");
|
||
|
|
||
|
echo("Connected to " . $mysqli->host_info . "\n");
|
||
|
|
||
|
echo("Installing database...\n");
|
||
|
|
||
|
$schema = file_get_contents("./sql/schema.sql");
|
||
|
|
||
|
if($mysqli->multi_query($schema)){
|
||
|
do {} while ($mysqli->more_results() && $mysqli->next_result());
|
||
|
};
|
||
|
|
||
|
if($error=$mysqli->error) {
|
||
|
die("An error has occured while setting up the database: $error");
|
||
|
};
|
||
|
|
||
|
echo("Setting default values...\n");
|
||
|
|
||
|
$settings = file_get_contents("./sql/settings.sql");
|
||
|
|
||
|
if($mysqli->multi_query($settings)){
|
||
|
do {} while ($mysqli->more_results() && $mysqli->next_result());
|
||
|
};
|
||
|
|
||
|
if($error=$mysqli->error) {
|
||
|
die("An error has occured while setting up the default values: $error");
|
||
|
};
|
||
|
|
||
|
echo("Done.");
|