无法跳至MySQL结果索引13的第0行 [英] Unable to jump to row 0 on MySQL result index 13

查看:100
本文介绍了无法跳至MySQL结果索引13的第0行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题错误的原因是什么?我在Mysql Front测试了mysql查询,没有问题.我的脚本在下面.谢谢.

What is the reason of the error on title? I tested mysql query at Mysql Front and no problem. My script is below. Thank you.

$fbFoodPerma = $fbSiteID."-".$fbFoodPerma;  
    $sql = mysql_query("  
        SELECT fbFoodPerma   
        FROM fbFoods   
        WHERE fbFoodPerma   
        LIKE '$fbFoodPerma'") or die(mysql_error());  
    $isStored = mysql_result($sql,0,"fbFoodPerma");  
    while ($isStored == "$fbFoodPerma") {  
    $fbFoodPerma = $fbFoodPerma."-";  
    $sql = mysql_query("  
        SELECT fbFoodPerma   
        FROM fbFoods   
        WHERE fbFoodPerma   
        LIKE '$fbFoodPerma'") or die(mysql_error());  
        $isStored = mysql_result($sql,0,"fbFoodPerma");  
        }  

推荐答案

嗯,尝试执行此操作以查看它是否正在拾取任何数据:

Hmm, try this to see if it is picking up any data at all:

$sql="SELECT * FROM fbFoods";
$query = mysql_query($sql) or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($query);

if ($num_rows > 0) {
    echo "rows found";
    } else {
    echo "none found";
}

还要确保$fbFoodPerma实际上包含某些内容-尝试在查询末尾回显它.

Also make sure that $fbFoodPerma actually contains something - try echoing it at the end of your query.

echo $fbFoodPerma;

这篇关于无法跳至MySQL结果索引13的第0行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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