punbb/include/enano_dbal.php
changeset 4 eb9ed4c366d0
parent 3 c0c445d4a13e
equal deleted inserted replaced
3:c0c445d4a13e 4:eb9ed4c366d0
    59 
    59 
    60 	function query($sql, $unbuffered = false)
    60 	function query($sql, $unbuffered = false)
    61 	{
    61 	{
    62     global $db;
    62     global $db;
    63 		if (defined('PUN_SHOW_QUERIES'))
    63 		if (defined('PUN_SHOW_QUERIES'))
    64 			$q_start = get_microtime();
    64 			$q_start = pun_microtime();
    65 
    65 
    66 		if ($unbuffered)
    66 		if ($unbuffered)
    67 			$this->query_result = $db->sql_unbuffered_query($sql);
    67 			$this->query_result = $db->sql_unbuffered_query($sql);
    68 		else
    68 		else
    69 			$this->query_result = $db->sql_query($sql);
    69 			$this->query_result = $db->sql_query($sql);
    70 
    70 
    71 		if ($this->query_result)
    71 		if ($this->query_result)
    72 		{
    72 		{
    73 			if (defined('PUN_SHOW_QUERIES'))
    73 			if (defined('PUN_SHOW_QUERIES'))
    74 				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
    74 				$this->saved_queries[] = array($sql, sprintf('%.5f', pun_microtime() - $q_start));
    75 
    75 
    76 			++$this->num_queries;
    76 			++$this->num_queries;
    77 
    77 
    78 			return $this->query_result;
    78 			return $this->query_result;
    79 		}
    79 		}