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?? Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/ 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 Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287609 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? Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287616 Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 whats the error message Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287617 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 Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287618 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"); Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287619 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 Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287620 Share on other sites More sharing options...
jakebur01 Posted July 2, 2007 Author Share Posted July 2, 2007 oh man it worked! Thank you. Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287624 Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 ;D Link to comment https://forums.phpfreaks.com/topic/58022-solved-trouble-with-query/#findComment-287626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.