Created
November 30, 2016 16:01
-
-
Save amalichev/4be67dd34644096b15ce0b48919321e1 to your computer and use it in GitHub Desktop.
Subrion | Отключение STRICT MODE в Mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function _connect() | |
{ | |
$this->_link = mysqli_init(); | |
if (!$this->_link) | |
{ | |
die('mysqli_init failed.'); | |
} | |
if (!mysqli_options($this->_link, MYSQLI_OPT_CONNECT_TIMEOUT, 5)) | |
{ | |
die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed.'); | |
} | |
mysqli_real_connect($this->_link, INTELLI_DBHOST, INTELLI_DBUSER, INTELLI_DBPASS, INTELLI_DBNAME, INTELLI_DBPORT); | |
if (!$this->_link) | |
{ | |
$message = !INTELLI_DEBUG ? 'Could not connect.' : 'Could not connect to the database. For more information see error logs.'; | |
die($message); | |
} | |
// set active database again | |
mysqli_select_db($this->_link, INTELLI_DBNAME); | |
$this->query("SET @@sql_mode = ''"); | |
$this->query("SET NAMES 'utf8'"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment