Changeset 9 for trunk/lib/DB.inc.php


Ignore:
Timestamp:
Sep 11, 2005 9:58:14 PM (19 years ago)
Author:
scdev
Message:

updated DB.inc.php so SET NAMES query is only used on MySQL versions > 4.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/DB.inc.php

    r8 r9  
    160160        $this->_connected = true;
    161161
    162         // Set the character set used for communicating with MySQL.
    163         $this->query("SET NAMES '" . $this->mysql_character_sets[strtolower(App::getParam('character_set'))] . "'");
     162        // Tell MySQL what character set we're useing.
     163        if (preg_match('/^4\.[1-9].*$|^5.*$/', mysql_get_server_info())) {
     164            $this->query("SET NAMES '" . $this->mysql_character_sets[strtolower(App::getParam('character_set'))] . "'");
     165        }
    164166       
    165167        return true;
Note: See TracChangeset for help on using the changeset viewer.