summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-12-31 14:45:02 +0100
committerAndreas Unterkircher <unki@netshadow.at>2007-12-31 14:45:02 +0100
commit18ecb83988277922d2743ace52b3ee4a74f35952 (patch)
treeeab3cc8fec0e9b82c4f8ab07011dd27377f57056
parentc41a9eaa542e16221f6849587aa50856c4898651 (diff)
issue85, fix SQL error when trying to sort photos by name on newer F-Spot database versions
-rw-r--r--phpfspot.class.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index b61f516..b3ad278 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -1951,10 +1951,20 @@ class PHPFSPOT {
return " ORDER BY p.time DESC";
break;
case 'name_asc':
- return " ORDER BY p.name ASC";
+ if($this->dbver < 9) {
+ return " ORDER BY p.name ASC";
+ }
+ else {
+ return " ORDER BY p.uri ASC";
+ }
break;
case 'name_desc':
- return " ORDER BY p.name DESC";
+ if($this->dbver < 9) {
+ return " ORDER BY p.name DESC";
+ }
+ else {
+ return " ORDER BY p.uri DESC";
+ }
break;
}