summaryrefslogtreecommitdiff
path: root/modules/user_favorites/module.php
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-06-01 22:45:00 +0000
committerfisharebest <fisharebest@gmail.com>2010-06-01 22:45:00 +0000
commit2be689de86622a917b2bbe48294424f72e19d527 (patch)
treeef49177d0b2ddacdf9726476f4305af5a14c5c79 /modules/user_favorites/module.php
parent3c211ff6d2625cbb6047586521b3306fdf9507af (diff)
downloadwebtrees-2be689de86622a917b2bbe48294424f72e19d527.tar.gz
webtrees-2be689de86622a917b2bbe48294424f72e19d527.tar.bz2
webtrees-2be689de86622a917b2bbe48294424f72e19d527.zip
Quote table names - to allow for "bad" choices of TBLPREFIX
Diffstat (limited to 'modules/user_favorites/module.php')
-rw-r--r--modules/user_favorites/module.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/user_favorites/module.php b/modules/user_favorites/module.php
index 78d67fd6c7..d4a2b1511d 100644
--- a/modules/user_favorites/module.php
+++ b/modules/user_favorites/module.php
@@ -310,7 +310,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block {
*/
public static function deleteFavorite($fv_id) {
return (bool)
- WT_DB::prepare("DELETE FROM ##favorites WHERE fv_id=?")
+ WT_DB::prepare("DELETE FROM `##favorites` WHERE fv_id=?")
->execute(array($fv_id));
}
@@ -324,7 +324,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block {
return false;
//-- make sure this is not a duplicate entry
- $sql = "SELECT 1 FROM ##favorites WHERE";
+ $sql = "SELECT 1 FROM `##favorites` WHERE";
if (!empty($favorite["gid"])) {
$sql.=" fv_gid=?";
$vars=array($favorite["gid"]);
@@ -342,7 +342,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block {
//-- add the favorite to the database
return (bool)
- WT_DB::prepare("INSERT INTO ##favorites (fv_id, fv_username, fv_gid, fv_type, fv_file, fv_url, fv_title, fv_note) VALUES (?, ? ,? ,? ,? ,? ,? ,?)")
+ WT_DB::prepare("INSERT INTO `##favorites` (fv_id, fv_username, fv_gid, fv_type, fv_file, fv_url, fv_title, fv_note) VALUES (?, ? ,? ,? ,? ,? ,? ,?)")
->execute(array(get_next_id("favorites", "fv_id"), $favorite["username"], $favorite["gid"], $favorite["type"], $favorite["file"], $favorite["url"], $favorite["title"], $favorite["note"]));
}
@@ -353,7 +353,7 @@ class user_favorites_WT_Module extends WT_Module implements WT_Module_Block {
*/
public static function getUserFavorites($username) {
$rows=
- WT_DB::prepare("SELECT * FROM ##favorites WHERE fv_username=?")
+ WT_DB::prepare("SELECT * FROM `##favorites` WHERE fv_username=?")
->execute(array($username))
->fetchAll();