summaryrefslogtreecommitdiffstats
path: root/application/libraries/Duser/drivers/Duser_db.php
diff options
context:
space:
mode:
authorRafael Bodill <rafi@sortex.co.il>2014-09-19 17:47:08 +0200
committerRafael Bodill <rafi@sortex.co.il>2014-09-19 17:47:08 +0200
commit7c100145ce197c86e1c849124daaa39ac6b240f5 (patch)
tree89cd87cff350b805d4f608b2c9813f50c22531a0 /application/libraries/Duser/drivers/Duser_db.php
parent0b62a117ca8d34331406a07dc52aa937ff76ace1 (diff)
parentd98ba32e9717a5e325d439e785c967f8cc44d095 (diff)
Merge branch 'pgsql_controllers'
* pgsql_controllers: Fix user/register mistaken query handling WIP: Cascading delete where_in for in array queries a proper count usage Fix timestamp adjusting for a list of arrays Correct unsupported open/close where query statements File controller uses query builder, except 2 queries Integrating query builder in models User controller queries built dynamically Query builder in user login and controller
Diffstat (limited to 'application/libraries/Duser/drivers/Duser_db.php')
-rw-r--r--application/libraries/Duser/drivers/Duser_db.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/application/libraries/Duser/drivers/Duser_db.php b/application/libraries/Duser/drivers/Duser_db.php
index a58b5a298..258de1820 100644
--- a/application/libraries/Duser/drivers/Duser_db.php
+++ b/application/libraries/Duser/drivers/Duser_db.php
@@ -22,11 +22,10 @@ class Duser_db extends Duser_Driver {
{
$CI =& get_instance();
- $query = $CI->db->query('
- SELECT username, id, password
- FROM `users`
- WHERE `username` = ?
- ', array($username))->row_array();
+ $query = $CI->db->select('username, id, password')
+ ->from('users')
+ ->where('username', $username)
+ ->get()->row_array();
if (empty($query)) {
return false;
@@ -46,11 +45,10 @@ class Duser_db extends Duser_Driver {
{
$CI =& get_instance();
- $query = $CI->db->query("
- SELECT id
- FROM users
- WHERE username = ?
- ", array($username));
+ $query = $CI->db->select('id')
+ ->from('users')
+ ->where('username', $username)
+ ->get();
if ($query->num_rows() > 0) {
return true;
@@ -63,11 +61,10 @@ class Duser_db extends Duser_Driver {
{
$CI =& get_instance();
- $query = $CI->db->query("
- SELECT email
- FROM users
- WHERE id = ?
- ", array($userid))->row_array();
+ $query = $CI->db->select('email')
+ ->from('users')
+ ->where('id', $userid)
+ ->get()->row_array();
if (empty($query)) {
show_error("Failed to get email address from db");