From fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Sat, 25 Aug 2012 01:52:27 +0200 Subject: add backticks to SQL, use limit parameter instead of LIMIT SQL --- apps/gallery/appinfo/app.php | 2 +- apps/gallery/appinfo/update.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/gallery/appinfo') diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index 9103f66441d..f26f23466be 100644 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -43,7 +43,7 @@ OCP\App::addNavigationEntry( array( class OC_GallerySearchProvider extends OC_Search_Provider{ function search($query){ - $stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ? AND album_name LIKE ?'); + $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*gallery_albums` WHERE `uid_owner` = ? AND `album_name` LIKE ?'); $result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%')); $results=array(); while($row=$result->fetchRow()){ diff --git a/apps/gallery/appinfo/update.php b/apps/gallery/appinfo/update.php index c1d22127428..65e7734c47f 100644 --- a/apps/gallery/appinfo/update.php +++ b/apps/gallery/appinfo/update.php @@ -2,9 +2,9 @@ $currentVersion=OC_Appconfig::getValue('gallery', 'installed_version'); if (version_compare($currentVersion, '0.5.0', '<')) { - $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_photos'); + $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS `*PREFIX*gallery_photos`'); $stmt->execute(); - $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_albums'); + $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS `*PREFIX*gallery_albums`'); $stmt->execute(); \OC_DB::createDbFromStructure(OC_App::getAppPath($appid).'/appinfo/database.xml'); -- cgit v1.2.3