From 6869890baf8a4b28d10c9915b412f0de1253fe3b Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Fri, 20 Jun 2008 15:17:09 +0000 Subject: [PATCH] Make the SAVEQUERIES define more flexible. Fixes #6764 props filosofo. git-svn-id: https://develop.svn.wordpress.org/trunk@8134 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/wp-db.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 920b7f9484..de53738d5d 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -11,9 +11,6 @@ define('OBJECT_K', 'OBJECT_K', false); define('ARRAY_A', 'ARRAY_A', false); define('ARRAY_N', 'ARRAY_N', false); -if (!defined('SAVEQUERIES')) - define('SAVEQUERIES', false); - class wpdb { var $show_errors = false; @@ -279,13 +276,13 @@ class wpdb { $this->last_query = $query; // Perform the query via std mysql_query function.. - if (SAVEQUERIES) + if ( defined('SAVEQUERIES') && SAVEQUERIES ) $this->timer_start(); $this->result = @mysql_query($query, $this->dbh); ++$this->num_queries; - if (SAVEQUERIES) + if ( defined('SAVEQUERIES') && SAVEQUERIES ) $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() ); // If there is an error then take note of it..