1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Fixed bug suppressing any output when mysql is not installed/enabled.

This commit is contained in:
Savetheinternet 2010-12-01 21:39:34 +11:00
parent 74e88bb664
commit 9f9861ad20

View File

@ -43,19 +43,21 @@
// Database
title('Database');
if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) {
$body .= check('Connection to server.', 'ok');
if(@mysql_select_db(MY_DATABASE, $sql))
$body .= check('Select database.', 'ok');
else {
$body .= check('Select database.', 'error');
if(extension_loaded('mysql')) {
if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) {
$body .= check('Connection to server.', 'ok');
if(@mysql_select_db(MY_DATABASE, $sql))
$body .= check('Select database.', 'ok');
else {
$body .= check('Select database.', 'error');
$todo[] = 'instance-config.php: Check database configuration.';
}
} else {
$body .= check('Connection to server.', 'error');
$todo[] = 'instance-config.php: Check database configuration.';
}
} else {
$body .= check('Connection to server.', 'error');
$todo[] = 'instance-config.php: Check database configuration.';
}
// Configuration
title('Configuration');
$root = dirname($_SERVER['REQUEST_URI']) . (dirname($_SERVER['REQUEST_URI']) == '/' ? '' : '/');