Hi everyone,

I'm writing a filter script in PHP that shows users a selection of
restaurants based on their criteria. Criteria options are:

- cuisine (eg Indian, Italian, Chinese etc)
- price range
- location
- facilities

At the moment, I have a fairly basic AJAX implementation which fetches
a list of venues, but separately. Eg, my form inputs to filter the
data look something like (abstracted for simplicity):

--Cuisine--
Italian: <input type="checkbox" onclick="getData(find_venues.php?
mode=cuisine&cuisineID=23">

--Price Range--
£0 - £10: <input type="checkbox" onclick="getData(find_venues.php?
mode=price&priceID=6">

My PHP page just queries the database using the appropriate WHERE
clause to get the relevant items.

My problem is that this doesn't return a unique list. These details
aren't exclusive (eg, a restaurant could be both Italian and within
the £0-10 price range) so often I'll get duplicate listings in my
results. I guess this means I need to build a WHERE query from all of
the user selections at once, rather than just adding to the existing
ones as I currently am.

I do want the AJAX flexibility to allow users to add/remove filters
too. Eg, they can click a checkbox for 'Chinese' and it will add all
the Chinese venues. When they uncheck it, those venues disappear.

As I say, I've managed to produce the basics, but have no idea how to
use Prototype to a) build a complex WHERE query and b) 'toggle' the
data when the user checks/unchecks a box.

Can anyone point me in the right direction for these things?

Thanks
Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to