Forum Moderators: coopster

Message Too Old, No Replies

Searching by multiple parameters pulled into menu boxes from MySQL DB

         

jjhenry78

7:34 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



Hello all,

I am beefing up a site I built to query sunday school classes for our church. I have built a database that list the groups based on ageRange, groupType, and meetingTime. Right now, I have set up the navigation to where you can only view groups based on one criteria, (i.e. all ageRange or all groupType)
I'd like to increase the functionality of this site and allow to refine the results by more than one or all of the parameters.
I have set up a form, which pulls all the info from the database into menus to select, and i set up the form function to go to a results page. It currently is sending the info correctly into the URL on the results page, however I think my MySQL statement is messing things up in the results.

My SQL statement is as follows:
"SELECT * FROM tblages, tblgroup, tbltimes, tbltypes WHERE (tblgroup.ageRangeID = %s
OR tblgroup.typeID = %s OR tblgroup.timeID = %s"

- i realize that "SELECT *" is not good, but i used it here for time saving.

Can anyone help me understand better how to handle and pass the multiple parameters from my search into the page? Thanks in advance.

eelixduppy

7:44 pm on Dec 23, 2008 (gmt 0)



This thread taken from our library [webmasterworld.com] might be of use to you to get your query headed in the correct direction: [webmasterworld.com...]

Take a look. :)

jjhenry78

10:17 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



Thanks for the help, that gets me somewhat closer, however, i am not using keywords so the use of LIKE may not be what i need. At least i think. I have 3 menus that are populated from the database where the ID field is the value. When sent to the results page, i want my SQL statement to check for any or all of the parameters sent, right now, it is not necessarily checking them correctly. Can you advise?