Esempio n. 1
0
 function Database($host, $port, $user, $password, $name)
 {
     $this->handle = mysql_connect($host, $user, $password, true);
     parent::helper($host, $port, $user, $password, $name);
     $out = mysql_select_db($name);
     if (!$out) {
         error_log(date("H:i") . " Cannot access base {$name}!\n\n", 3, LOGS_PATH . date("Y-m-d") . "-odb.log");
         die;
     }
     if (strlen(DB_CLIENT_ENCODING) > 0 && DB_CLIENT_ENCODING != "DB_CLIENT_ENCODING") {
         mysql_set_charset(DB_CLIENT_ENCODING, $this->handle);
         //$this->query("SET client_encoding = '".DB_CLIENT_ENCODING."'");
     }
 }