• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
num_rows() problem

#1
hello,

my user model is:
PHP Code:
<?php
class User extends CI_Model{

    function 
__construct() {
        
$this->tableName 'aauth_users';
        
$this->primaryKey '*';
    }

    public function 
checkUser($data = []){
        
$this->db->select($this->primaryKey);
        
$this->db->from($this->tableName);
        
$this->db->where([
            
'oauth_uid'      => $data['oauth_uid']
        ]);
        
$prevQuery $this->db->get();
        return 
$prevQuery->num_rows();
    }



but checkUser() always return 0 !
My CI PRJ's : l1nk.ir : a fast link shortner | FileStar.ir : a File Seller site!
Reply

#2
You could debug with $this->db->last_query();
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.