Right, I thought the rules were mentioned in the first post. Apoplogies. The user should be able to enter one value or all 6 and with each additional value added from none, the results should be more refined. i.e. Alabama chosen only - all jobs in Alabama come back Alabama and Financing - all financing jobs in Alabama come back Alabama , Financing and 5 days old, all financing jobs in Alabama within the last 5 days come back Alabam, Financing, 5 days old, and treasurer, all financing jobs in Alabama, no more then 5 days old with the job title of treasurer.
You raise a good point , that I thought about and then cast to the side temporarily. No I don't want all data coming back, so probably with no values entered at all then no records come back. >From my understanding now , to do something like this the query needs to be created on the fly withink the script. So if no values exist, no array exists, on to the next field with an OR, if values exists, take the values input into an array , onto next field with an AND. I think that is it , now if I only knew how to code ;) Stuart --- [EMAIL PROTECTED] wrote: > Stuart. > > If your queries must match _all_ of your input > variables, you are in the > situation where you only need ANDs (no ORs needed). > Just create one term > in your WHERE statement for each field they filled > in and make sure that > there is an AND between each of them in the right > places. This should be > a piece of simple string building along the same > lines you are already > doing. > > I think that the reason that nobody, including > myself, can tell you how to > write your script is because you never told us > _your_ rules on how each > field is supposed to be handled. Build your WHERE > clause so that it meets > _your_ requirements and it should work correctly. > > Of course, no input from the user means you don't > need a WHERE clause at > all. You can regurgitate your entire database. This > may be something you > want to avoid by requiring at least 1 or 2 input > values. > > Shawn Green > Database Administrator > Unimin Corporation - Spruce Pine > > Stuart Felenstein <[EMAIL PROTECTED]> wrote on > 09/22/2004 03:11:16 PM: > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]