Change count() to sizeof()

This commit is contained in:
Ice
2008-08-09 13:27:34 +00:00
parent 2a37786346
commit 2f7427a29e
7 changed files with 16 additions and 16 deletions

View File

@@ -28,19 +28,19 @@ function get_db_stat($mode)
switch( $mode )
{
case 'announcmenttotal':
$sql = 'SELECT COUNT(distinct t.topic_id) AS announcment_total
$sql = 'SELECT sizeof(distinct t.topic_id) AS announcment_total
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE t.topic_type = ' . POST_ANNOUNCE . '
AND p.post_id = t.topic_first_post_id';
break;
case 'stickytotal':
$sql = 'SELECT COUNT(distinct t.topic_id) AS sticky_total
$sql = 'SELECT sizeof(distinct t.topic_id) AS sticky_total
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE t.topic_type = ' . POST_STICKY . '
AND p.post_id = t.topic_first_post_id';
break;
case 'attachmentstotal':
$sql = 'SELECT COUNT(attach_id) AS attachments_total
$sql = 'SELECT sizeof(attach_id) AS attachments_total
FROM ' . ATTACHMENTS_TABLE;
break;
}