make tag search case insensitive
authorArun Persaud <arun@nubati.net>
Sun, 27 Nov 2011 06:52:37 +0000 (22:52 -0800)
committerArun Persaud <apersaud@lbl.gov>
Sun, 27 Nov 2011 06:52:37 +0000 (22:52 -0800)
getjson.php

index 14af09b3003bf7feb5f81a728e52b56f72228d79..007ef7c7d181c9f816d57eb2bcc5ab652aee3c9b 100644 (file)
@@ -42,12 +42,12 @@ else
        $result = $DB->query("SELECT base_uri, filename FROM photos ".
                             "    left join photo_tags on photos.id=photo_tags.photo_id ".
                             "    left join tags on tags.id=photo_tags.tag_id ".
        $result = $DB->query("SELECT base_uri, filename FROM photos ".
                             "    left join photo_tags on photos.id=photo_tags.photo_id ".
                             "    left join tags on tags.id=photo_tags.tag_id ".
-                            "    where tags.name in ($tags) LIMIT $OFFSET, $N");
+                            "    where tags.name COLLATE NOCASE in ($tags) LIMIT $OFFSET, $N");
 
        $count = $DB->query("SELECT count(*) as total FROM photos ".
                            "    left join photo_tags on photos.id=photo_tags.photo_id ".
                            "    left join tags on tags.id=photo_tags.tag_id ".
 
        $count = $DB->query("SELECT count(*) as total FROM photos ".
                            "    left join photo_tags on photos.id=photo_tags.photo_id ".
                            "    left join tags on tags.id=photo_tags.tag_id ".
-                           "    where tags.name in ($tags)");
+                           "    where tags.name COLLATE NOCASE in ($tags)");
 
       }
     else
 
       }
     else