[FX.php List] Query question

Bob Patin bob at patin.com
Thu Jan 25 16:14:06 MST 2007


This is funny: when I did a search of the old FX emails from the  
past, I found that I'd asked this exact question once before, and no  
one had a solution other than to re-query for each different situation.

My problem is that I need to create a report where there might be 20  
different catalog numbers, and then the searcher might also include a  
city or state or zip code. I hate to think that I'd have to do 20  
different queries to build a single table of results...

I'd sure love to hear a solution for this one...

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com

   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060


On Jan 25, 2007, at 5:00 PM, Bob Patin wrote:

> I can't believe I've not had to do this type of search before:
>
> I need to search 5 or more fields; in one of the fields, I need to  
> search for 1 or more different catalog numbers. So a search would  
> be like this:
>
> CITY -- 1 value here
> STATE - 1 value here
> ZIP - 1 value here
> CATALOG NUMBER - could be a bunch of different cat. numbers
>
> I'd thought that I could just concatenate the catalog numbers like  
> this:
>
> $cat_num=AB001 AB002 AB003 ... and so on
>
> and then search the catalog_number field using a single line  
> AddDBParam('cat_num',$cact_num);
>
> But this doesn't work right. if I add an OR conditional, doesn't it  
> apply to the whole query?
>
> How do I search for this:
>
> (these first 3 must match)
> Nashville
> TN
> 37211
>
> plus, it must contain 1 of these catalog numbers:
> AB001 or AB002	
>
> I know this is simple, but I can't remember how this is done...
>
> Thanks,
>
> Bob Patin
> bob at patin.com
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list