[eluser]thisischris[/eluser]
I have the following code in a library:
Code:
private $CI;
public function __construct()
{
$this->CI =& get_instance();
}
public function authenticate($username, $password)
{
$query = $this->CI->db->get_where('users', ['name' => $username, 'password' => md5($password)], 1, 0);
$rowCount = $this->CI->db->count_all_results();
if ($rowCount == 1)
{
var_dump($rowCount);
$record = $query->row();
$user = ['name' => $record->name, 'id' => $record->id, 'admin' => $record->admin];
return $user;
}
else
{
return false;
}
}
The database is completely empty yet rowCount is being set as 1?