diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-08-25 01:52:27 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-08-25 01:52:27 +0200 |
commit | fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b (patch) | |
tree | 7b3a6c1b946273ee0f1f3f6ade1f9cd3483004dc /apps/media/lib/share/artist.php | |
parent | fd5af9aff4245127f32f3b90dbd6e52792984447 (diff) | |
download | nextcloud-server-fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b.tar.gz nextcloud-server-fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b.zip |
add backticks to SQL, use limit parameter instead of LIMIT SQL
Diffstat (limited to 'apps/media/lib/share/artist.php')
-rw-r--r-- | apps/media/lib/share/artist.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/media/lib/share/artist.php b/apps/media/lib/share/artist.php index 7218fa1a279..d08a53da2a7 100644 --- a/apps/media/lib/share/artist.php +++ b/apps/media/lib/share/artist.php @@ -22,7 +22,7 @@ class OC_Share_Backend_Artist extends OCP\Share_Backend { public function getSource($item, $uid) { - $query = OCP\DB::prepare('SELECT artist_id FROM *PREFIX*media_artists WHERE artist_id = ? AND song_user = ?'); + $query = OCP\DB::prepare('SELECT `artist_id` FROM `*PREFIX*media_artists` WHERE `artist_id` = ? AND `song_user` = ?'); $result = $query->execute(array($item, $uid))->fetchRow(); if (is_array($result)) { return array('item' => $item, 'file' => $result['song_path']); @@ -43,10 +43,10 @@ class OC_Share_Backend_Artist extends OCP\Share_Backend { $ids = "'".implode("','", $ids)."'"; switch ($format) { case self::FORMAT_SOURCE_PATH: - $query = OCP\DB::prepare('SELECT path FROM *PREFIX*fscache WHERE id IN ('.$ids.')'); + $query = OCP\DB::prepare('SELECT `path` FROM `*PREFIX*fscache` WHERE `id` IN ('.$ids.')'); return $query->execute()->fetchAll(); case self::FORMAT_FILE_APP: - $query = OCP\DB::prepare('SELECT id, path, name, ctime, mtime, mimetype, size, encrypted, versioned, writable FROM *PREFIX*fscache WHERE id IN ('.$ids.')'); + $query = OCP\DB::prepare('SELECT `id`, `path`, `name`, `ctime`, `mtime`, `mimetype`, `size`, `encrypted`, `versioned`, `writable` FROM `*PREFIX*fscache` WHERE `id` IN ('.$ids.')'); $result = $query->execute(); $files = array(); while ($file = $result->fetchRow()) { |