add questioning

This commit is contained in:
Steve Alberty
2001-08-10 08:32:45 +00:00
parent 3597f8e3ad
commit 86f5362f4a

View File

@@ -38,21 +38,28 @@ if (defined('PHP_OS') && eregi('win', PHP_OS)) {
} }
// MySQL Version // MySQL Version
$result = @mysql_query('SELECT VERSION() AS version');
if ($result != FALSE && @mysql_num_rows($result) > 0) { if (!empty($server)){
$row = mysql_fetch_array($result); $result = mysql_query('SELECT VERSION() AS version');
define('MYSQL_MAJOR_VERSION', (double)substr($row['version'], 0, 4)); if ($result != FALSE && @mysql_num_rows($result) > 0) {
define('MYSQL_MINOR_VERSION', (double)substr($row['version'], 5)); $result = mysql_query('SELECT VERSION() AS version') or mysql_die();
} else { $row = mysql_fetch_array($result);
$result = @mysql_query('SHOW VARIABLES like \'version\''); define('MYSQL_MAJOR_VERSION', (double)substr($row['version'], 0, 4));
if ($result != FALSE && @mysql_num_rows($result) > 0){ define('MYSQL_MINOR_VERSION', (double)substr($row['version'], 5));
$row = mysql_fetch_row($result);
define('MYSQL_MAJOR_VERSION', (double)substr($row[1], 0, 4));
define('MYSQL_MINOR_VERSION', (double)substr($row[1], 5));
} else { } else {
define('MYSQL_MAJOR_VERSION', 3.21); $result = @mysql_query('SHOW VARIABLES like \'version\'');
define('MYSQL_MINOR_VERSION', 0); if ($result != FALSE && @mysql_num_rows($result) > 0){
$row = mysql_fetch_row($result);
define('MYSQL_MAJOR_VERSION', (double)substr($row[1], 0, 4));
define('MYSQL_MINOR_VERSION', (double)substr($row[1], 5));
} else {
define('MYSQL_MAJOR_VERSION', 3.21);
define('MYSQL_MINOR_VERSION', 0);
}
} }
} }
else{
define('MYSQL_MAJOR_VERSION', 3.21);
define('MYSQL_MINOR_VERSION', 0);
}
?> ?>