本文整理匯總了PHP中MySql::is_active方法的典型用法代碼示例。如果您正苦於以下問題:PHP MySql::is_active方法的具體用法?PHP MySql::is_active怎麽用?PHP MySql::is_active使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MySql
的用法示例。
在下文中一共展示了MySql::is_active方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: set_sql_performance
/**
* set sql performance measuring (to output hidden in output)
*
* @access public
*
* @author patrick.kracht
*/
public function set_sql_performance()
{
if (MsSql::is_active() || MySql::is_active()) {
// append MsSql-performance-output
if (MsSql::is_active()) {
$ret = "\nPERFORMANCE ( MSSQL )\n";
$tick = MsSql::get_query_count() . " QS";
$time = MsSql::get_query_timer() . " MS";
$ret .= " | mssql_query_count " . self::align_right($tick) . "\n";
$ret .= " | mssql_query_time " . self::align_right($time) . "\n";
self::$sql_perform .= $ret;
}
// append MySql-performance-output
if (MySql::is_active()) {
$ret = "\nPERFORMANCE ( MYSQL )\n";
$tick = MySql::get_query_count() . " QS";
$time = MySql::get_query_timer() . " MS";
$ret .= " | mysql_query_count " . self::align_right($tick) . "\n";
$ret .= " | mysql_query_time " . self::align_right($time) . "\n";
self::$sql_perform .= $ret;
}
} else {
return trigger_error('Bitte laden Sie eine Datenbank-Klasse vor der Ausgabe durch die Template-Klasse!');
}
}
示例2: close
/**
* closes mysql-connection
*
* @param mixed link resource
*
* @access public
*
* @author patrick.kracht
*/
public function close($link_id = -1)
{
if ($link_id != -1) {
self::$link_id = $link_id;
}
@mysql_close(self::$link_id);
self::$is_active = false;
}