From c64dd2df81249436e30cd29b86bdd7d2092c8544 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 24 Jul 2006 18:24:56 +0000 Subject: [PATCH] Use AND instead of HAVING. #2604 git-svn-id: https://develop.svn.wordpress.org/trunk@4039 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/category.php b/wp-includes/category.php index 30392a7594..1ea9b9d536 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -70,9 +70,9 @@ function &get_categories($args = '') { $having = ''; if ( $hide_empty ) { if ( 'link' == $type ) - $having = 'HAVING link_count > 0'; + $where .= ' AND link_count > 0'; else - $having = 'HAVING category_count > 0'; + $where .= ' AND category_count > 0'; } if ( !empty($number) ) @@ -80,7 +80,7 @@ function &get_categories($args = '') { else $number = ''; - $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where $having ORDER BY $orderby $order $number"); + $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where ORDER BY $orderby $order $number"); if ( empty($categories) ) return array();