From 51ab51f6a487cd793e523aebb61ed43c2b7314bf Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Thu, 19 Jul 2007 14:27:22 +0000 Subject: fixed SQL syntax error on AND conjunction of multiple tags git-svn-id: file:///var/lib/svn/phpfspot/trunk@224 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index f572759..2c3170c 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -636,6 +636,10 @@ class PHPFSPOT { ON pt1.photo_id=pt". ($i+2) .".photo_id "; } + $query_str.= " + INNER JOIN photos p + ON pt1.photo_id=p.id + "; $query_str.= "WHERE pt1.tag_id=". $_SESSION['selected_tags'][0]; for($i = 1; $i < count($_SESSION['selected_tags']); $i++) { $query_str.= " @@ -1633,21 +1637,19 @@ class PHPFSPOT { { switch($_SESSION['sort_order']) { case 'date_asc': - return "ORDER BY p.time ASC"; + return " ORDER BY p.time ASC"; break; case 'date_desc': - return "ORDER BY p.time DESC"; + return " ORDER BY p.time DESC"; break; case 'name_asc': - return "ORDER BY p.name ASC"; + return " ORDER BY p.name ASC"; break; case 'name_desc': - return "ORDER BY p.name DESC"; + return " ORDER BY p.name DESC"; break; } - return $_SESSION['sort_order']; - } // get_sort_order() } -- cgit v1.2.3-18-g5258