summaryrefslogtreecommitdiffstats
path: root/application/libraries/Duser
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-19 23:04:20 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-10-19 23:04:41 +0200
commitc8d9d70f60ccc8d77180627852810453375c91fd (patch)
tree72cdbe776fce9dccefb13610913ff24dcd3d92e4 /application/libraries/Duser
parent111c356f7833d1619f0da75d019c390a424d6445 (diff)
parent1abe7372404a9d65f3b59eda2d83e628267b366d (diff)
Merge postgresql support
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/libraries/Duser')
-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");