出于某种原因,PHP 在我的 Web 服务器上引发了错误,但不是在本地:
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
现在,第 79 行有问题的函数是这样的:
功能 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()); }