From 2f4c3ea0bea3c698b0fab5fdaf13ec6843af7acd Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 28 May 2006 16:06:58 +0000 Subject: counting on primary key should be slightly faster... git-svn-id: file:///svn/phpbb/trunk@5979 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index a4d22d3caa..6793866c9f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -239,7 +239,7 @@ if (!($topic_data = $db->sql_fetchrow($result))) // This is for determining where we are (page) if ($post_id) { - $sql = "SELECT COUNT(*) AS prev_posts + $sql = "SELECT COUNT(p.post_id) AS prev_posts FROM " . POSTS_TABLE . " p WHERE p.post_approved = 1 AND p.topic_id = {$topic_data['topic_id']} -- cgit v1.2.1