当我试图访问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))) {
}警告: mysql_result() Function.mysql-结果:无法跳转到第11行MySQL结果索引5中的profile.php上的第0行
发布于 2012-09-29 04:18:07
此警告意味着$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))) {
}
}https://stackoverflow.com/questions/12649594
复制相似问题