Failed to navigate to line 0 by MySQL result index 13

What is the reason for the error in the title? I tested mysql query on Mysql Front and no problem. My script is below. Thanks.

$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");  
        }  

      

+2


a source to share


1 answer


Hmm, try this to see if it collects 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";
}

      



Also make sure that it $fbFoodPerma

really contains something - try repeating it at the end of your query.

echo $fbFoodPerma;

      

+4


a source







All Articles