summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-07-19 14:27:22 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-07-19 14:27:22 +0000
commit51ab51f6a487cd793e523aebb61ed43c2b7314bf (patch)
tree7d05c422f811f73795bab695593142d2aacf66aa
parent2f3810822ac7a62e17aebccb286068a8b69e5a19 (diff)
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
-rw-r--r--phpfspot.class.php14
1 files changed, 8 insertions, 6 deletions
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()
}