I am getting a fatal error, I tried to find a solution in stackoverflow and other forum but I can't seem to find it.
Error looks like:
Fatal error: Call to a member function query() on string in /home/......./check.php on line 19
class M_login extends CI_Model{
public function num_of_students($name,$adress){
$sql="select * from tbl_admin where name='$name' and address='$address'";
$query=$this->db->query($sql);
return $query->num_rows();
}