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
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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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