]> git.mjollnir.org Git - s9y.git/commitdiff
Fix "WHERE 1" condition to work in pgsql.
authorgarvinhicking <garvinhicking>
Tue, 9 Aug 2005 16:45:38 +0000 (16:45 +0000)
committergarvinhicking <garvinhicking>
Tue, 9 Aug 2005 16:45:38 +0000 (16:45 +0000)
include/admin/comments.inc.php

index 74a9340bc6ef8c53c39a49f37410e317113e6788..2777df7b8bba70891dfae7a1ff06986b3a6469d8 100644 (file)
@@ -140,7 +140,7 @@ if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
 }
 
 /* Paging */
-$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and, true);
+$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE 1 = 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and, true);
 
 $totalComments = $sql['total'];
 $pages = ($commentsPerPage == COMMENTS_FILTER_ALL ? 1 : ceil($totalComments/(int)$commentsPerPage));
@@ -160,7 +160,7 @@ if ($commentsPerPage == COMMENTS_FILTER_ALL) {
 
 $sql = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
                                 LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
-                                WHERE 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and
+                                WHERE 1 = 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and
                                 . (!serendipity_checkPermission('adminEntriesMaintainOthers') ? 'AND e.authorid = ' . (int)$serendipity['authorid'] : '') . "
                                 ORDER BY c.id DESC $limit");
 ?>