summaryrefslogtreecommitdiffstats
path: root/wp-admin/wpmu-users.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-21 16:17:09 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-21 16:17:09 +0000
commitcaa5736145f34315f81efc70fd01997fb59ce154 (patch)
tree9743f15ceb7bfe3352a2d4842d15db5884a2af77 /wp-admin/wpmu-users.php
parent2e4a2003485fcc5d0220942eb404d7dc60a54b7a (diff)
downloadwordpress-mu-caa5736145f34315f81efc70fd01997fb59ce154.tar.gz
wordpress-mu-caa5736145f34315f81efc70fd01997fb59ce154.tar.xz
wordpress-mu-caa5736145f34315f81efc70fd01997fb59ce154.zip
SQL optimizations, fixes #642, thanks momo360modena
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1389 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/wpmu-users.php')
-rw-r--r--wp-admin/wpmu-users.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/wp-admin/wpmu-users.php b/wp-admin/wpmu-users.php
index 47238b9..b2ef439 100644
--- a/wp-admin/wpmu-users.php
+++ b/wp-admin/wpmu-users.php
@@ -68,10 +68,9 @@ if ( $_GET['updated'] == 'true' ) {
$query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC';
if( !empty( $s )) {
- $user_list = $wpdb->get_results( $query, ARRAY_A );
- $total = count($user_list);
+ $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(ID)', $query) );
} else {
- $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->users}");
+ $total = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users}");
}
$query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num );