diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-04-17 03:28:36 +0400 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-04-17 03:28:36 +0400 |
commit | daf61bae2c485a1a95a0dd1875344b612d08a72a (patch) | |
tree | 7adb58c3300e91c03e7fcc1f9ff74f9df92dd844 /reader | |
parent | 181d8c0e332a8c1a74542a7ecb151b6f2e57e94e (diff) | |
parent | eff5a40773692c319bbaaeaff245bd2335760e65 (diff) |
Merge Kondou-ger-proper_sql_queries into master
Diffstat (limited to 'reader')
-rwxr-xr-x | reader/lib/tag_utils.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/reader/lib/tag_utils.php b/reader/lib/tag_utils.php index 7d77a3feb..dd6aa474b 100755 --- a/reader/lib/tag_utils.php +++ b/reader/lib/tag_utils.php @@ -1,6 +1,6 @@ <?php function find_tags_for_ebook($path_of_ebook) { - $sql = 'SELECT tags FROM *PREFIX*eBook_library WHERE filepath = ?'; + $sql = 'SELECT `tags` FROM `*PREFIX*eBook_library` WHERE `filepath` = ?'; $stmt = OCP\DB::prepare($sql); $res = $stmt->execute(array($path_of_ebook)); $tags = NULL; @@ -14,7 +14,7 @@ function update_tag_for_ebook($new_tag,$path_of_ebook) { $tags = find_tags_for_ebook($path_of_ebook); $each_tag = explode(",",$tags); if (count($each_tag) < 5) { - $stmt = OCP\DB::prepare("UPDATE *PREFIX*eBook_library SET tags = ? WHERE filepath = ?"); + $stmt = OCP\DB::prepare("UPDATE `*PREFIX*eBook_library` SET `tags` = ? WHERE `filepath` = ?"); $stmt->execute(array($new_tag,$path_of_ebook)); } else @@ -22,12 +22,12 @@ function update_tag_for_ebook($new_tag,$path_of_ebook) { } function insert_new_tag($new_tag,$path_of_ebook) { - $stmt = OCP\DB::prepare('INSERT INTO *PREFIX*eBook_library (filepath,tags) VALUES (?, ?)'); + $stmt = OCP\DB::prepare('INSERT INTO `*PREFIX*eBook_library` (`filepath`,`tags`) VALUES (?, ?)'); $stmt->execute(array($path_of_ebook,$new_tag)); } function find_results_with_tag_like($tag) { - $sql = 'SELECT * FROM *PREFIX*eBook_library WHERE tags LIKE ?'; + $sql = 'SELECT * FROM `*PREFIX*eBook_library` WHERE `tags` LIKE ?'; $stmt = OCP\DB::prepare($sql); $res = $stmt->execute(array($tag)); return $res; @@ -38,7 +38,7 @@ function check_consistency_with_database($root,$pdfs) { foreach ($pdfs as $pdf) { $new_array_pdfs[] = $root.$pdf; } - $sql = 'SELECT filepath from *PREFIX*ebook_library'; + $sql = 'SELECT `filepath` from `*PREFIX*ebook_library`'; $stmt = OCP\DB::prepare($sql); $res = $stmt->execute(); while ($r = $res->fetchRow()) { @@ -48,7 +48,7 @@ function check_consistency_with_database($root,$pdfs) { } function delete_entry($filepath) { - $sql = 'DELETE FROM *PREFIX*eBook_library WHERE filepath = ?'; + $sql = 'DELETE FROM `*PREFIX*eBook_library` WHERE filepath = ?'; $stmt = OCP\DB::prepare($sql); $res = $stmt->execute(array($filepath)); } |