예제 #1
0
require_once $config_file;
require_once "includes/misc.php";
require_once "includes/password_modules.php";
require_once "includes/database.php";
// clean output buffer
ob_end_clean();
$pony_db = new pony_db();
if (!$pony_db->connect($mysql_host, $mysql_user, $mysql_pass)) {
    echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>';
    echo '<div style="border:#ee0000 solid 1px;	background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">';
    echo 'Cannot connect to mysql database, check settings in configuration file `<b>config.php</b>`.<br />';
    echo 'MySQL error: ' . mysql_error();
    echo '</div>';
    die;
}
if (!$pony_db->select_db($mysql_database)) {
    echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>';
    echo '<div style="border:#ee0000 solid 1px;	background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">';
    echo 'Cannot select mysql database, please, check if the `<b>' . $mysql_database . '</b>` database exists or you have enough rights to create new databases.<br />';
    echo 'MySQL error: ' . mysql_error() . '.';
    echo '</div>';
    die;
}
$all_tables_exist = $pony_db->all_tables_exist();
$some_tables_exist = $pony_db->some_tables_exist();
if (!$pony_db->state) {
    echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>';
    echo '<div style="border:#ee0000 solid 1px;	background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">';
    echo 'Unknown MySQL error occured: ' . mysql_error() . '.';
    echo '</div>';
    die;