summaryrefslogtreecommitdiffstats
path: root/application/libraries/Duser/drivers/Duser_db.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-10 20:57:15 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-10-10 20:57:15 +0200
commitdbb2247b82ab49c50f424c904ac98702507f1a8e (patch)
tree8de007c3f61f621b02ecb93d4a2730e00d79c613 /application/libraries/Duser/drivers/Duser_db.php
parentba760ba7280265cb49e38a2b039c42d5bdfd6b9d (diff)
parentc902a13c01583e83fda7f8188130e01f2d3bb141 (diff)
Merge remote-tracking branch 'rafi/master' into rafi
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");