Fix bug where server_config table does not exist (OTHire as an example)

Happened in Usage_Statistics class
Thanks for reporting the OtLand user - Olddies
This commit is contained in:
slawkens 2018-10-31 07:45:50 +01:00
parent a4bccbaa34
commit dacc5b9dab

View File

@ -39,11 +39,13 @@ class Usage_Statistics {
$ret['myaac_version'] = MYAAC_VERSION;
$ret['myaac_db_version'] = DATABASE_VERSION;
$query = $db->query('SELECT `value` FROM `server_config` WHERE `config` = ' . $db->quote('database_version'));
if($query->rowCount() == 1) {
$query = $query->fetch();
$ret['otserv_db_version'] = $query['value'];
if(tableExist('server_config')) {
$query = $db->query('SELECT `value` FROM `server_config` WHERE `config` = ' . $db->quote('database_version'));
if($query->rowCount() == 1) {
$query = $query->fetch();
$ret['otserv_db_version'] = $query['value'];
}
}
$ret['client_version'] = $config['client'];