本文整理汇总了PHP中Mysql::test方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::test方法的具体用法?PHP Mysql::test怎么用?PHP Mysql::test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::test方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
/** static public function test
* Test the MySQL connection
*
* @param void
* @return bool connection OK
*/
public static function test()
{
if (!is_null(self::$_instance)) {
return true;
}
if (!Mysql::test()) {
return false;
}
// look for anything in the settings table
$query = "\n\t\t\tSELECT *\n\t\t\tFROM `" . self::SETTINGS_TABLE . "`\n\t\t";
$return = Mysql::get_instance()->query($query);
return (bool) $return;
}
示例2: define
}
// set our DEBUG constant
$GLOBALS['_&_DEBUG_QUERY'] = '';
$GLOBALS['_?_DEBUG_QUERY'] = '';
if (!defined('DEBUG')) {
if (test_debug()) {
define('DEBUG', true);
// DO NOT CHANGE THIS ONE
} else {
define('DEBUG', (bool) $debug);
// set to true for output of debugging code
}
}
$GLOBALS['_LOGGING'] = DEBUG;
// do not change, rather, change debug value
if (Mysql::test()) {
$Mysql = Mysql::get_instance();
$Mysql->set_settings(array('log_path' => LOG_DIR, 'email_subject' => GAME_NAME . ' Query Error'));
if (class_exists('Settings') && Settings::test()) {
$Mysql->set_settings(array('log_errors' => Settings::read('DB_error_log'), 'email_errors' => Settings::read('DB_error_email'), 'email_from' => Settings::read('from_email'), 'email_to' => Settings::read('to_email')));
}
}
if (defined('DEBUG') && DEBUG) {
ini_set('display_errors', 'On');
error_reporting(-1);
// everything
if (isset($Mysql)) {
$Mysql->set_error(3);
}
}
// log the player in