fetch array error when using logical operators
Posted: Tue Dec 03, 2002 12:50 am
I'm having some issues with a bit of code that you folks might be able to help me with. When I use the logical operator AND to retrieve rows with mysql_fetch_array it throws an exception. I'm enclosing two examples, one with the AND operator, and one without. The one without works fine, the one with the operator fails. The error I get is
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Here's the code:Code: Select all
if ( $links == "Operating Systems" ){ $result=mysql_query ( "select * FROM Links WHERE LinkType = 'Operating Systems'" ); while ($row = mysql_fetch_array($result)){ printf (nl2br("<a class="red" href="http://$rowї3]" target="_blank">$rowї2]</a><p>$rowї4]</p><br>")); } } if ( $links == "Small Business Links" ){ $result=mysql_query ( "select * FROM Links WHERE LinkType = ('Small Business Links') AND (LinkShowHide = Hide)" ); while ($row = mysql_fetch_array($result)) { printf (nl2br("<a class="red" href="http://$rowї3]" target="_blank">$rowї2]</a><p>$rowї4]</p><br>")); } }