Changeset 202 for dev

Show
Ignore:
Timestamp:
04/05/07 16:14:36 (14 years ago)
Author:
exi
Message:

Fixed a bug belonging to the new mysql version code.

Location:
dev/common/includes
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dev/common/includes/class.db.php

    r195 r202  
    55    function DBConnection() 
    66    { 
     7        static $conn_id; 
     8 
     9        if (is_resource($conn_id)) 
     10        { 
     11            $this->id_ = $conn_id; 
     12            return; 
     13        } 
    714        if (!$this->id_ = mysql_connect(DB_HOST, DB_USER, DB_PASS)) 
    815            die("Unable to connect to mysql database."); 
    916 
    1017        mysql_select_db(DB_NAME); 
     18        $conn_id = $this->id_; 
    1119    } 
    1220 
  • dev/common/includes/class.db_cache.php

    r201 r202  
    55    function DBConnection() 
    66    { 
     7        static $conn_id; 
     8 
     9        if (is_resource($conn_id)) 
     10        { 
     11            $this->id_ = $conn_id; 
     12            return; 
     13        } 
    714        if (!$this->id_ = mysql_connect(DB_HOST, DB_USER, DB_PASS)) 
    815            die("Unable to connect to mysql database."); 
    916 
    1017        mysql_select_db(DB_NAME); 
     18        $conn_id = $this->id_; 
    1119    } 
    1220 
  • dev/common/includes/db.php

    r201 r202  
    1515// get mysql server info and store it in a define so we know if its 
    1616// safe to use subquerys or not 
    17 $value = (float)mysql_get_server_info(); 
     17$conn = new DBConnection; 
     18$value = (float)mysql_get_server_info($conn->id_); 
    1819if ($value > 4.1) 
    1920{