[FX.php List] Query question

Troy Meyers tcmeyers at troymeyers.com
Fri Jan 26 08:43:46 MST 2007


Bob,

I guess I don't understand enough to see how this would not be practical. I don't want to sidetrack your search for the best method, but for my sake and perhaps others, could you tell me what part of the idea is the bad part?

I don't know how to write this PHP code yet, but I had thought it would be possible since it's more powerful than CDML where doing what I suggested wouldn't be possible without tricky FileMaker scripts. It seems to me that PHP should be able to do this without FileMaker scripts. Here goes:

The form is submitted and the user has filled in several fields, let's say all of the ones you originally mentioned:

CITY -- 1 value here
STATE - 1 value here
ZIP - 1 value here
CATALOG NUMBER - could be a bunch of different cat. numbers

The PHP that deals with the form submission would gather the form parameters into variables, and instruct FileMaker to do a search using all of the filled out fields EXCEPT the catalog number.

Next step, in the same PHP file, use PHP string manipulation in a loop to parse out catalog numbers one by one, getting rid of commas and spaces and newlines, etc. and construct a Constrain find _request_ for each until the catalog number field is empty.

PHP would then ask FileMaker to do the Constrain Found Set, just once, for all the new requests just added.

Then use the result from there, as you normally would.

As I said, other than the fact I'm too green to know how to write this and try it, it seems simple. Why wouldn't this work?

-Troy


> Troy,
> 
> It's really not practical though; my clients need to be able to  
> login, do different reports on the fly, and I really don't want to   try
> to do this with a script. For one thing, the searches are going   to be
> mix-and-match using 4 or 5 fields in addition to the field that   can
> contain as many as 30 or 40 different catalog numbers.
> 
> I'm afraid the FOREACH that Dan suggested is going to be my only  
> option, but I certainly don't like it much.
> 
> Another thought I just had though, would be to use an EDIT to edit a  
> key field to contain the catalog values, and then retrieve the portal  
> results that get triggered when I set this key field. I may try that;  
> any thoughs on that idea, guys?
> 
> Bob
> 
> On Jan 25, 2007, at 5:29 PM, Troy Meyers wrote:
> 
> > Bob, > > As you know I'm new to PHP, but wouldn't the best plain
> FileMaker   > way to do this be to do a 'Find' with the fields that are
> common to   > all first, and then do a single 'Constrain Found Set' with
> the   > catalog number queries each as its own record/request (i.e.
> ORing   > them)? > > If that works in FileMaker, wouldn't there be a way
> to set this up   > in PHP? > > -Troy > > >> 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 > >
> _______________________________________________ > FX.php_List mailing
> list > FX.php_List at mail.iviking.org >
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> 
> 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