0

I am using CodeIgniter for my project. In model I have written a function to verify whether similar datas are available or not. I have used rowcount() too. But I can't solve the problem. Here is my code:

public function  student_verification()
{
    $email = $this->input->post('email');
    $verification = $this->input->post('verification');
    $row = $this->db->query("SELECT * FROM student_sign_up WHERE email = '$email' AND verification = '$verification'  ");
    if(mysql_num_rows($row)>0)
    return true;
    else
    return false;
u_mulder
  • 54,101
  • 5
  • 48
  • 64

1 Answers1

2

Kindly use $row->num_rows(); instead of mysql_num_rows($row) .

Have look here https://www.codeigniter.com/userguide3/database/results.html .

It will return the number of the rows.

Ashish Tiwari
  • 1,919
  • 1
  • 14
  • 26