diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-09-20 14:57:59 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-09-20 15:19:49 +0200 |
commit | 731dbac7d399928f4e1137031689796b0721c75e (patch) | |
tree | 5abbbc70f9f17d60c583847b69ff5546b9269aa2 /application/service | |
parent | 49c8b94e5a2839da7fb9c370ce199b9c06b4a6cf (diff) |
postgres: Fix multiple queries using MySQL syntax
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/service')
-rw-r--r-- | application/service/files.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/application/service/files.php b/application/service/files.php index adc62c7dc..c65660b75 100644 --- a/application/service/files.php +++ b/application/service/files.php @@ -31,12 +31,12 @@ class files { } $total_size = $CI->db->query(" - SELECT coalesce(sum(filesize), 0) sum + SELECT coalesce(sum(sub.filesize), 0) sum FROM ( - SELECT DISTINCT `".$CI->db->dbprefix."file_storage`.id, filesize - FROM `".$CI->db->dbprefix."file_storage` - JOIN `".$CI->db->dbprefix."files` ON `".$CI->db->dbprefix."file_storage`.id = `".$CI->db->dbprefix."files`.file_storage_id - WHERE user = ? + SELECT DISTINCT fs.id, filesize + FROM ".$CI->db->dbprefix."file_storage fs + JOIN ".$CI->db->dbprefix."files f ON fs.id = f.file_storage_id + WHERE f.user = ? ) sub ", array($user))->row_array(); |