summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-01-12 12:00:30 +0100
committerAndreas Unterkircher <unki@netshadow.at>2008-01-12 12:00:30 +0100
commit2283995d7df3de43454a11729a3296c5300d0f49 (patch)
tree54d310504c0fc1d5f0d110f3d10088eafecedb7a /phpfspot.class.php
parent50466123d97dd9d1afe299cba60e11be61f5077a (diff)
issue97, add missing DISTINCT keyword to SQL query
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 9cffc58..c2ec3ac 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -874,7 +874,7 @@ class PHPFSPOT {
/* return all available photos */
$query_str = "
- SELECT p.id
+ SELECT DISTINCT p.id
FROM photos p
LEFT JOIN photo_tags pt
ON p.id=pt.photo_id
@@ -886,10 +886,10 @@ class PHPFSPOT {
$query_str.= "WHERE ". $additional_where_cond ." ";
if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) {
- if(isset($additional_where_cond))
- $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags). "')";
- else
- $query_str.= "WHERE t.name IN ('".implode("','",$this->cfg->show_tags). "')";
+ if(isset($additional_where_cond))
+ $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags). "')";
+ else
+ $query_str.= "WHERE t.name IN ('".implode("','",$this->cfg->show_tags). "')";
}
if(isset($order_str))