*/ public function open() { if($this->isOpen) return true; try { $server = $this->host . ($this->port ? ':' . $this->port : ''); if($this->persistent) { $this->conn = mysql_pconnect($server, $this->username, $this->password); } else { $this->conn = mysql_connect($server, $this->username, $this->password, true); } if($this->errorOccured()) throw new Exception(); mysql_select_db($this->dbname, $this->conn); mysql_query("SET NAMES utf8", $this->conn); mysql_query("SET CHARSET utf8", $this->conn); mysql_query("SET CHARACTER SET utf8", $this->conn); mysql_query("SET character_set_client = 'utf8'", $this->conn); mysql_query("SET SESSION collation_connection = 'utf8_general_ci'", $this->conn);
try { $server = $this->host . ($this->port ? ':' . $this->port : ''); if($this->persistent) { $this->conn = mysql_pconnect($server, $this->username, $this->password); } else { $this->conn = mysql_connect($server, $this->username, $this->password, true); } if($this->errorOccured()) throw new Exception(); mysql_select_db($this->dbname, $this->conn); mysql_query("SET NAMES utf8", $this->conn); mysql_query("SET CHARSET utf8", $this->conn);
* Выполняет запрос к БД * @param String $queryString строка запроса * @param Boolean $noCache true - кэшировать результат, false - не кэшировать * @return Resource результат выполнения запроса */ public function query($queryString, $noCache = false) { if(!$this->open()) return false; $queryString = trim($queryString, " \t\n"); if(defined('SQL_QUERY_DEBUG') && SQL_QUERY_DEBUG) { echo $queryString, "\r\n"; }
static $pool, $i = 0; if(is_null($pool)) { $pool = ConnectionPool::getInstance(); } $conn = $pool->getConnection($className); $result = $conn->query($sql, $no_cache); return $result; } function l_mysql_real_escape_string($inputString, $className = 'core') { static $pool = null;
clusterCacheSync::getInstance(); } $remoteIP = getServer('REMOTE_ADDR'); $blackIps = array(); $result1 = l_mysql_query("SHOW TABLES LIKE 'cms3_objects'"); $result2 = l_mysql_query("SHOW TABLES LIKE 'cms3_object_types'"); if(mysql_num_rows($result1) && mysql_num_rows($result2)) { $result = l_mysql_query("SELECT name FROM `cms3_objects` where type_id = (SELECT id FROM `cms3_object_types` where guid='ip-blacklist')"); while($row = mysql_fetch_array($result)){ $blackIps[] = $row[0]; }
<?php require CURRENT_WORKING_DIR . '/libs/config.php'; showWorkTime("config readed"); // Patch for Flex files uploader if (isset($_SERVER['HTTP_USER_AGENT']) && (strstr($_SERVER['HTTP_USER_AGENT'], 'Shockwave Flash')!== false || strstr($_SERVER['HTTP_USER_AGENT'], 'Adobe Flash Player')) && isset($_GET['PHPSESSID'])) {
if ($__isYiiHandler) { error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED); require_once __DIR__ . '/yii/index.php'; } else { define("CURRENT_WORKING_DIR", str_replace("\\", "/", $dirname = dirname(__FILE__))); require __DIR__ . '/libs/root-src/index.php'; }
$_GET = [ 'path' => 'emarket/addToCompare/35271', ];