]> git.mjollnir.org Git - s9y.git/commitdiff
SQLite compatibvility
authorgarvinhicking <garvinhicking>
Mon, 2 Jul 2007 10:26:03 +0000 (10:26 +0000)
committergarvinhicking <garvinhicking>
Mon, 2 Jul 2007 10:26:03 +0000 (10:26 +0000)
include/functions_comments.inc.php

index e33bceb23bd09a2d17a3dea0e99c8f788f5e2f3e..a7a15ab65e1c145e6faf6b5036f5b1887f753719 100644 (file)
@@ -169,12 +169,12 @@ function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = f
                     co.id AS commentid,
                     co.parent_id AS parent_id
               FROM
-                    {$serendipity['dbPrefix']}comments co
-                    LEFT JOIN {$serendipity['dbPrefix']}entries e ON (co.entry_id = e.id)
+                    {$serendipity['dbPrefix']}comments AS co
+                    LEFT JOIN {$serendipity['dbPrefix']}entries AS e ON (co.entry_id = e.id)
               WHERE co.type LIKE '" . $type . "' AND co.entry_id > 0 $and
               $group
               ORDER BY
-                    " . ($where != '' ? '' : 'co.id') . " " . ($order != '' ? $order : '') . "
+                    " . ($where != '' ? '' : 'co.id') . " " . ($where == '' && $order != '' ? ',' : '') . ($order != '' ? $order : '') . "
                     $limit";
     $comments = serendipity_db_query($query, false, 'assoc');