Make WordPress Core


Ignore:
Timestamp:
07/24/2006 06:24:56 PM (20 years ago)
Author:
ryan
Message:

Use AND instead of HAVING. #2604

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category.php

    r4015 r4039  
    7171        if ( $hide_empty ) {
    7272                if ( 'link' == $type )
    73                         $having = 'HAVING link_count > 0';
     73                        $where .= ' AND link_count > 0';
    7474                else
    75                         $having = 'HAVING category_count > 0';
     75                        $where .= ' AND category_count > 0';
    7676        }
    7777
     
    8181                $number = '';
    8282
    83         $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where $having ORDER BY $orderby $order $number");
     83        $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where ORDER BY $orderby $order $number");
    8484
    8585        if ( empty($categories) )
Note: See TracChangeset for help on using the changeset viewer.