jakebur01 Posted July 2, 2007 Share Posted July 2, 2007 hey when I add the "WHERE catid != TBP " in I get this error: PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in heres the code: $result=mysqli_query($db, "SELECT isbn, description, catid, title, author ". "FROM books ". "WHERE catid != TBP ". "order by isbn asc ". "limit $offset,$limit" ); any ideas?? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 $result=mysqli_query($db, "SELECT isbn, description, catid, title, author FROM books WHERE catid != TBP order by isbn asc limit $offset,$limit"); try that Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted July 2, 2007 Author Share Posted July 2, 2007 ha.. I couldn't get that to work either. I even tried it like this: <?php $db = mysql_connect("", "", ""); mysql_select_db("", $db); $result = mysql_query("SELECT * FROM books WHERE catid <> TBP", $db); while($myrow = mysql_fetch_array($result)) { $catid = $myrow['catid']; $title = $myrow['isbn'].' '.$myrow['description'].' '.$myrow['title'].' '.$myrow['author']; $url = "show_cat.php?catid=$catid"; echo "<small"; ?> <a href="<?php echo $url; ?>"><?php echo $title; ?></a><br /> <?php echo"</small>"; echo "<br />"; } I don't want any of the rows where TBP is catid. Basically... I've tried Where catid <> and i tried where catid != ... Any suggestions? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 whats the error message Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted July 2, 2007 Author Share Posted July 2, 2007 PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 ok lets debug remove the $db and do you really have the connection any way try that first $result = mysql_query("SELECT * FROM books WHERE catid <> TBP"); Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 oops $result = mysql_query("SELECT * FROM books WHERE catid <> 'TBP' "); forgot put '' on TBP Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted July 2, 2007 Author Share Posted July 2, 2007 oh man it worked! Thank you. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 ;D 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.