home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / defines_mysql.lib.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  1.1 KB  |  41 lines

  1. <?php
  2. /* $Id: defines_mysql.lib.php,v 2.1 2003/11/26 22:52:23 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. /**
  6.  * DEFINES MYSQL RELATED VARIABLES & CONSTANTS
  7.  * Overview:
  8.  *    PMA_MYSQL_INT_VERSION    (int)    - eg: 32339 instead of 3.23.39
  9.  */
  10.  
  11. if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
  12.     if (!empty($server)) {
  13.         $result = PMA_mysql_query('SELECT VERSION() AS version', $userlink);
  14.         if ($result != FALSE && @mysql_num_rows($result) > 0) {
  15.             $row   = PMA_mysql_fetch_array($result);
  16.             $match = explode('.', $row['version']);
  17.             mysql_free_result($result);
  18.         }
  19.     } // end server id is defined case
  20.  
  21.     if (!isset($match) || !isset($match[0])) {
  22.         $match[0] = 3;
  23.     }
  24.     if (!isset($match[1])) {
  25.         $match[1] = 23;
  26.     }
  27.     if (!isset($match[2])) {
  28.         $match[2] = 32;
  29.     }
  30.  
  31.     if(!isset($row)) {
  32.         $row['version'] = '3.23.32';
  33.     }
  34.  
  35.     define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
  36.     define('PMA_MYSQL_STR_VERSION', $row['version']);
  37.     unset($result, $row, $match);
  38. }
  39.  
  40. ?>
  41.