summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpfspot.class.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 99f5a17..0553204 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -866,13 +866,14 @@ class PHPFSPOT {
/* return all available photos */
$query_str = "
- SELECT DISTINCT photo_id
- FROM photo_tags pt
- INNER JOIN photos p
+ SELECT p.id
+ FROM photos p
+ LEFT JOIN photo_tags pt
ON p.id=pt.photo_id
- INNER JOIN tags t
+ LEFT JOIN tags t
ON pt.tag_id=t.id
";
+
if(isset($additional_where_cond))
$query_str.= "WHERE ". $additional_where_cond ." ";
@@ -885,7 +886,7 @@ class PHPFSPOT {
$result = $this->db->db_query($query_str);
while($row = $this->db->db_fetch_object($result)) {
- array_push($matched_photos, $row['photo_id']);
+ array_push($matched_photos, $row['id']);
}
return $matched_photos;