Hello guys,
I have been trying to fix these errors, but it wont work. This are the errors im getting
Warning: mysqli_query() expects parameter 1 to be mysqli, object given in /home/335456/public_html/hoi/class.user.php on line 35
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/335456/public_html/hoi/class.user.php on line 36
This is the code where the error appears, does anyone know what i'm doing wrong?
/*** for login process ***/
public function check_login($emailusername,$password){
$password = md5($password);
$sql2="SELECT userid from users WHERE username='$emailusername' or email='$emailusername' and password='$password'";
//checking if the username is available in the table
$result = mysqli_query($this->db,$sql2);
$user_data = mysqli_fetch_array($result);
$count_row = $result->num_rows;