probably something like this:
Code:
select *
from categories c
inner join businesscategories bc on c.id = bc.categoryid
inner join businesses b on bc.businessid = b.id
where c.categoryname = $selection and b.name = $otherselection
Although as I think about it, shouldn't filter based on text like that... unless you're allowing wildcards in the selection... but if they are limited to only what's in the db...
Code:
select *
from businesses b
inner join businesscategories bc on b.id = bc.businessid
where c.id = $selection and b.id = $businessidselection
-tg