```
$a=$this->db->where('username', $user);
echo $a->num_rows();

```

I have tried this, but getting this error

```
Fatal error: Call to undefined method CI_DB_mysql_driver::num_rows() in C:\xampp\htdocs\Testing\CI\application\models\mymodel.php on line 20

```