jagguy Posted April 8, 2007 Share Posted April 8, 2007 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'); Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 8, 2007 Share Posted April 8, 2007 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 Quote Link to comment Share on other sites More sharing options...
per1os Posted April 8, 2007 Share Posted April 8, 2007 $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. Quote Link to comment Share on other sites More sharing options...
jagguy Posted April 9, 2007 Author Share Posted April 9, 2007 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.