i have a problem regarding mysql_result() the error message is
Warning: mysql_result() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\project\classes\User.php on line 23
i know that there's many questions like this here that had been answered, i tried everything but it still give me this error
this is my User class
<?php
class User {
public function login($logindata = array()) {
$user_type = $this->get_user_type($logindata['user_username']);
$this->logindata = Sanitize::escape($logindata);
echo $user_type;
print_r($this->logindata);
}
private function get_user_type($username) {
$this->username = Sanitize::escape($username);
$querytype = mysql_query("
SELECT `user_type`
FROM `ei_users`
WHERE `user_username` = '$this->username'
");
return mysql_result($querytype, 0, 'user_type');
}
}
i already tried return mysql_result($querytype, 0, 'user_type'); but still the same error. can someone know how to solve this? thanks in advance - Peace