本文整理匯總了PHP中MySQLDatabase::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP MySQLDatabase::__construct方法的具體用法?PHP MySQLDatabase::__construct怎麽用?PHP MySQLDatabase::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MySQLDatabase
的用法示例。
在下文中一共展示了MySQLDatabase::__construct方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Extends the MySQLDatabase class for the option disabling shutdownqueries
*/
public function __construct($host, $user, $password, $database, $charset = 'utf8', $usePConnect = false, $autoSelect = true)
{
if (defined('NO_SHUTDOWN_QUERIES')) {
$this->useShutdownQueries = false;
}
parent::__construct($host, $user, $password, $database, $charset, $usePConnect, $autoSelect);
}
示例2: __construct
public function __construct($parameters)
{
if (static::$firstTime) {
static::$firstTime = false;
// deregister the Silverstripe exception and error handlers
restore_exception_handler();
restore_error_handler();
}
parent::__construct($parameters);
}
示例3: __construct
public function __construct($parameters)
{
parent::__construct($parameters);
}
示例4: __construct
public function __construct()
{
parent::__construct();
}
示例5: __construct
public function __construct($parameters)
{
parent::__construct($parameters);
$this->query('SET AUTOCOMMIT=1;');
}
示例6: __construct
/**
* Connect to a MySQL database.
* @param array $parameters An map of parameters, which should include:
* - server: The server, eg, localhost
* - username: The username to log on with
* - password: The password to log on with
* - database: The database to connect to
*/
public function __construct($parameters)
{
parent::__construct($parameters);
$this->query("SET sql_mode = 'ANSI'");
}