Пример #1
0
 /**
  * @return FWS_DB_MySQL_Connection the db-connection-class
  */
 protected function db()
 {
     $c = new FWS_DB_MySQLi_Connection();
     $c->connect(TDL_MYSQL_HOST, TDL_MYSQL_LOGIN, TDL_MYSQL_PASSWORD);
     $c->select_database(TDL_MYSQL_DATABASE);
     $c->set_save_queries(false);
     $c->set_escape_values(false);
     $version = $c->get_server_version();
     if ($version >= '4.1') {
         $c->execute('SET CHARACTER SET ' . TDL_DB_CHARSET . ';');
         // we don't want to have any sql-modes
         $c->execute('SET SESSION sql_mode="";');
     }
     return $c;
 }
Пример #2
0
 /**
  * @return FWS_DB_Connection the property
  */
 protected function db()
 {
     include_once FWS_Path::server_app() . 'config/mysql.php';
     $c = new FWS_DB_MySQLi_Connection();
     $c->connect(PC_MYSQL_HOST, PC_MYSQL_LOGIN, PC_MYSQL_PASSWORD);
     $c->select_database(PC_MYSQL_DATABASE);
     $c->set_save_queries(false);
     $c->set_escape_values(true);
     $version = $c->get_server_version();
     if ($version >= '4.1') {
         $c->execute('SET CHARACTER SET utf8;');
         // we don't want to have any sql-modes
         $c->execute('SET SESSION sql_mode="";');
     }
     return $c;
 }