Resolve table ambiguity.Props filosofo. fixes #3091

git-svn-id: https://develop.svn.wordpress.org/trunk@4155 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-09-01 18:50:58 +00:00
parent 5ad1b21683
commit 936b87defb
+1 -1
View File
@@ -482,7 +482,7 @@ function _max_num_pages() {
if ( 'posts' == get_query_var('what_to_show') ) {
preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches);
$fromwhere = $matches[1];
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT $wpdb->posts.ID) FROM $fromwhere");
$max_num_pages = ceil($numposts / $posts_per);
} else {
preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches);