PHP Error: Unable to jump to row 0 on MySQL

For some reason, PHP is throwing the error on my web server but not locally:

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 16 in /home/a8576801/public_html/indev/core/functions/users.php on line 79

Now, the function in question at line 79 goes as such:

function user_id_from_username($username) {
    $username = sanitize($username);
    return mysql_result(mysql_query("SELECT `user_id` FROM `users` WHERE `user_name` = '$username'"), 0, 'user_id') or die(mysql_error());
}

It might be that $username is NULL. Echo the username and confirm there is a value associated with it.

might want to check out Unable to jump to row 0 on MySQL result index 13 as well


Wow ok sorry everyone. Dumb mistake on my part. I called the function in the wrong file.

FIXED !

链接地址: http://www.djcxy.com/p/69884.html

上一篇: PHP语法检查:解析错误:语法错误?

下一篇: PHP错误:无法跳转到MySQL上的第0行