diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-10-03 10:14:54 -0700 |
---|---|---|
committer | Jean-Christophe Saad-Dupuy <saad.dupuy@gmail.com> | 2013-10-06 20:31:11 +0200 |
commit | bf7516112f90ea0392918605acdb9167cf21e516 (patch) | |
tree | d97628451386a2ec254f3c93b29741267140bd14 /inc/poche/Database.class.php | |
parent | 79026b73a804d1fe3715c3edf5bc2cfb1e56732c (diff) | |
parent | d47d2533accb30a69fbbb964f63793b821300974 (diff) | |
download | wallabag-bf7516112f90ea0392918605acdb9167cf21e516.tar.gz wallabag-bf7516112f90ea0392918605acdb9167cf21e516.tar.zst wallabag-bf7516112f90ea0392918605acdb9167cf21e516.zip |
Embeded jquery 2.0.3 dependancie
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r-- | inc/poche/Database.class.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 4d664992..0662581b 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -113,9 +113,17 @@ class Database { | |||
113 | } | 113 | } |
114 | 114 | ||
115 | public function updateUserConfig($userId, $key, $value) { | 115 | public function updateUserConfig($userId, $key, $value) { |
116 | $sql_update = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; | 116 | $config = $this->getConfigUser($userId); |
117 | $params_update = array($value, $userId, $key); | 117 | |
118 | $query = $this->executeQuery($sql_update, $params_update); | 118 | if (!isset ($user_config[$key])) { |
119 | $sql = "INSERT INTO users_config (`value`, `user_id`, `name`) VALUES (?, ?, ?)"; | ||
120 | } | ||
121 | else { | ||
122 | $sql = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; | ||
123 | } | ||
124 | |||
125 | $params = array($value, $userId, $key); | ||
126 | $query = $this->executeQuery($sql, $params); | ||
119 | } | 127 | } |
120 | 128 | ||
121 | private function executeQuery($sql, $params) { | 129 | private function executeQuery($sql, $params) { |