I am having a problem with mysql_num_rows. when i try to login, the following warning occurs: Warning: mysql_num_rows() expects parameter 1 to be resource, object given in path/to/userClass.php in line #no.I searched for that error, and got that, it is caused because of wrong sql query. But i am not sure about that. Please help.Userclass.phplogin function\[code\]$sql = "SELECT id, username FROM `user` WHERE username = '$username' AND hashed_password ='$password'";$result = mysqli_query( $this->con, $sql );if ( !$result ) die ("Database query failed" . mysql_error());else{ $count = mysql_num_rows( $result ); if( $count == 1 ){ $found_user = mysql_fetch_array( $result ); $_SESSION['user_id'] = $found_user['id']; $_SESSION['username'] = $found_user['username']; header( "Location:{$location}" ); }else{ //username/password combo was not found in the database $this->pass_notverified = "Username/password incorrect."; return; }}\[/code\]header.php\[code\]<?php require_once 'class/userClass.php';?><?php $obj = new userClass;?> <?php if( isset( $_POST['login'] ) ){ $obj->login( $_POST,"home.php" );}?>\[/code\]