You're producing a query of the form
SELECT x,y,z FROM table WHERE cat ="a,b,c" AND subcat="d,e,f";
Try: IMPLODE("\" OR \"",$category)
or maybe even IMPLODE('" OR "',$category) to remove all the escaping.
Doug
On Fri, 1 Mar 2002 16:14:17 -, John Lodge wrote:
>This is the sort of thing
This is the sort of thing I would do
$tmpquery = "SELECT item_pic, cat, sub, item_name, username FROM item_name
WHERE 1=1 AND";
if($category)
{
$filter1 = " cat =\"";
$filter1 .= implode("\",\"",$category);
$filter1 .= " \" ";
$tmpquery .= $filter1;
$tmpquery .= " AND ";
}
if($subcat)
{
$filter2