Hi guys,
Trying to get a search feature running. A table has 2 field 'itemname' and 'itemdescription'.
I would like the search to use a keyword on both of these fields but i'm unsure of how to seperate it from the main query.
$query = "SELECT " .sellerid . "," . itemname . "," . itemtype . "," . itemstate . "," . itemprice . "," . pic1 . "," . itemid . "," . itemdescription . " FROM item where " . itemtype . "= '$ctype' AND " . itemstate . " like '$stype' AND " . itemprice . " >= '$lprice' AND " . itemprice . " <= '$hprice' AND " . itemdescription . " like '%$kwords%' OR " . itemname . " like '%$kwords%' ORDER BY itemprice DESC
LIMIT $offset, $rowsPerPage";
The OR seems to be working on the whole query not just the last little bit like i would wish.
" . itemdescription . " like '%$kwords%' OR " . itemname . " like '%$kwords%'
Something like this but contained in the main query? Does this make sense?
Thanks