当我尝试访问 profile.php?u=destiny
//$result = mysql_query('SELECT name FROM
$imageresult = mysql_query("SELECT name FROM imagetable WHERE id = '$id'") or die(mysql_error());
$u = mysql_result($imageresult, 0 ,"name") or die(mysql_error());
//error_reporting(E_ALL);
if (isset($id) && (!isset($u))) {
}
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 5 in profile.php on line 11
最佳答案
此警告意味着 $imageresult
变量中没有行。检查一下,这应该有效:
$imageresult = mysql_query("SELECT name FROM imagetable WHERE id = '$id'") or die(mysql_error());
if (mysql_num_rows($imageresult) > 0) {
$u = mysql_result($imageresult, 0 ,"name") or die(mysql_error());
if (isset($id) && (!isset($u))) {
}
}
关于php - 警告 : mysql_result() [function. mysql-result] : Unable to jump to row 0 on MySQL result index 5 in profile. php on line 11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12649594/