Jump to content

warning problem


jagguy

Recommended Posts

I get a warning problem and i can't see anythong wrong with the code. Also this fails on my livesite but not on my pc.

 

 

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 204 in /home/jagguy/public_html/zen/includes/languages/english/html_includes/custom/define_myspecials.php on line 77

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 204 in /home/jagguy/public_html/zen/includes/languages/english/html_includes/custom/define_myspecials.php on line 78

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 204 in /home/jagguy/public_html/zen/includes/languages/english/html_includes/custom/define_myspecials.php on line 79

 

  $sql2="select   a.categories_id  ,parent_id ,categories_name
          from   products_to_categories a ,categories b ,categories_description c where
         a.categories_id= b.categories_id  and  b.categories_status=1 and c.categories_id= b.categories_id
          and a.products_id='$pid'";
    $result2 = mysql_query($sql2)    or die("Invalid query: " . mysql_error());

    $parid= mysql_result($result2, 0, 'parent_id'); //line77
    $catid=  mysql_result($result2, 0, 'categories_id');//line 78 etc
    $catname=  mysql_result($result2, 0, 'categories_name');

Link to comment
Share on other sites

i dont know much about the _result, but look at actually getting the array mysql_fetch_array, and looping through that

 

i think thats the more popular way of doing it, and i know whats how id do it, but i dont know for certain, i dont use _result.

 

 

good luck

Link to comment
Share on other sites

  $sql2="select   a.categories_id  ,parent_id ,categories_name
          from   products_to_categories a ,categories b ,categories_description c where
         a.categories_id= b.categories_id  and  b.categories_status=1 and c.categories_id= b.categories_id
          and a.products_id='$pid'";
    $result2 = mysql_query($sql2)    or die("Invalid query: " . mysql_error());

    $parid= mysql_result($result2, 1, 'parent_id'); //line77
    $catid=  mysql_result($result2, 1, 'categories_id');//line 78 etc
    $catname=  mysql_result($result2, 1, 'categories_name');

 

Try that. If not that than this will work:

 

  $sql2="select   a.categories_id  ,parent_id ,categories_name
          from   products_to_categories a ,categories b ,categories_description c where
         a.categories_id= b.categories_id  and  b.categories_status=1 and c.categories_id= b.categories_id
          and a.products_id='$pid'";
    $result2 = mysql_query($sql2)    or die("Invalid query: " . mysql_error());

$row = mysql_fetch_array($result2);
$parid = $row['parent_id'];
$catid = $row['categories_id'];
$catname = $row['categories_name'];

 

Now this will work for 1 row, which it seems like you are doing if you want more than one than you would need to put that into a while loop.

 

Hope that works out for ya.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.