From 91bd244393ae40e302e3c1e0f7fedb01ddeee957 Mon Sep 17 00:00:00 2001 From: Rafael Bodill Date: Thu, 18 Sep 2014 22:05:08 +0300 Subject: Query builder in user login and controller --- application/controllers/user.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'application/controllers/user.php') diff --git a/application/controllers/user.php b/application/controllers/user.php index 079f1665c..45bd93816 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -102,11 +102,13 @@ class User extends MY_Controller { $key = random_alphanum(32); - $this->db->query(" - INSERT INTO `apikeys` - (`key`, `user`, `comment`, `access_level`) - VALUES (?, ?, ?, ?) - ", array($key, $userid, $comment, $access_level)); + $this->db->set([ + 'key' => $key, + 'user' => $userid, + 'comment' => $comment, + 'access_level' => $access_level + ]) + ->insert('apikeys'); if (static_storage("response_type") == "json") { return send_json_reply(array("new_key" => $key)); -- cgit v1.2.3-24-g4f1b