Click to See Complete Forum and Search --> : MYSQL Query Problems...


CSmith1128
05-06-2004, 04:38 PM
$this->search = mysql_query("SELECT * FROM membership_items WHERE expired='0' AND paid='yes' AND itemcategory='$this->category' AND itemprice >= '$this->priceStart' AND itemprice <= '$this->priceEnd' AND itemname LIKE '%$this->nameKeyword%' OR itemdescription LIKE '%$this->descKeyword%' ");

while($this->items = mysql_fetch_array($this->search, MYSQL_ASSOC))
{
$this->itemName = $this->items["ItemName"];
$this->itemID = $this->items["ItemID"];
$this->color = $this->items["Color"];
$this->bold = $this->items["Bold"];
$this->italic = $this->items["Italic"];
$this->itemPrice = $this->items["ItemPrice"];

echo $this->itemName . "<br>";
echo $this->itemID . "<br>";
echo $this->color . "<br>";
echo $this->bold . "<br>";
echo $this->italic . "<br>";
echo $this->itemPrice . "<br>";
}



Can anyone tell me what is wrong with that query above?.. When i run it, it returns items that have "a" in there name and description, but itemprice and everythning else doesnt work.

Also, i was wondering how it was possible to make the search results go to multiple pages, with a "next" button that will take me to the next page. Can anyone help with that too?

Thanks.