警告:mysql_result()[function.mysql-result]:无法跳到第11行的profile.php中MySQL结果索引5的第0行 [英] Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 5 in profile.php on line 11

查看:87
本文介绍了警告:mysql_result()[function.mysql-result]:无法跳到第11行的profile.php中MySQL结果索引5的第0行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试访问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-result]:无法跳转到行 第11行的profile.php中MySQL结果索引5为0

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 5 in profile.php on line 11

推荐答案

此警告表示$imageresult变量中没有行.检查一下,这应该可以工作:

This warning means that there is no row in the $imageresult var. Check it out, this should work:

$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))) {
  }
}

这篇关于警告:mysql_result()[function.mysql-result]:无法跳到第11行的profile.php中MySQL结果索引5的第0行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆