summaryrefslogtreecommitdiffstats
path: root/application/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'application/libraries')
-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");