Changeset 172 for trunk/lib/DB.inc.php
- Timestamp:
- Jun 15, 2006 7:59:45 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/DB.inc.php
r156 r172 17 17 // Database handle. 18 18 var $dbh; 19 20 // Count how many queries run during the whole instance. 21 var $_query_count = 0; 19 22 20 23 // Hash of DB parameters. … … 229 232 function query($query, $debug=false) 230 233 { 231 static $_query_count = 0;232 234 $app =& App::getInstance(); 233 235 … … 236 238 } 237 239 238 $_query_count++; 240 $this->_query_count++; 241 239 242 $debugqry = preg_replace("/\n[\t ]+/", "\n", $query); 240 243 if ($this->getParam('db_always_debug') || $debug) { 241 echo "<!-- ----------------- Query $ _query_count ---------------------\n$debugqry\n-->\n";244 echo "<!-- ----------------- Query $this->_query_count ---------------------\n$debugqry\n-->\n"; 242 245 } 243 246 … … 342 345 } 343 346 } 347 348 /* 349 * Return the total number of queries run this for. 350 * 351 * @access public 352 * @return int Number of queries 353 * @author Quinn Comendant <quinn@strangecode.com> 354 * @version 1.0 355 * @since 15 Jun 2006 11:46:05 356 */ 357 function numQueries() 358 { 359 return $this->_query_count; 360 } 344 361 345 362 /**
Note: See TracChangeset
for help on using the changeset viewer.