advanced filtering
Moderator: General Moderators
advanced filtering
Hi, Does anybody know of a script I can use for advanced filtering? I need to be able to filter by four or five different things or none at all or only some, and on top of that there has to be ordering.... It's a lot of work and I was just wondering if I can reuse someone's code since it's a pretty basic function of database driven sites...
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re:
sorry for not being more specific. I know basic SQL and could probably write it up myself, but it's pretty tedious to write the code so that it looks through all the filtering data collected from the form and generate SQL based on that. I just thought maybe there is a code snippet out there somewhere that i could just reuse...
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
ah - what you're looking for is an ORM: "Object Relational Mapping"
Propel and Doctrine are the "big two", but there's a more exhaustive list here:
http://en.wikipedia.org/wiki/List_of_ob ... ftware#PHP
Propel and Doctrine are the "big two", but there's a more exhaustive list here:
http://en.wikipedia.org/wiki/List_of_ob ... ftware#PHP
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
So for all the smart, jerky young boys whose parents fill out forms completely:
Code: Select all
SELECT * FROM kids WHERE group='brats' AND gender='M' AND age<10 AND incomplete_profile='No' AND test_scores>90(#10850)
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: