Jump to content

[SOLVED] trouble with query


jakebur01

Recommended Posts

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

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?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.