[FX.php List] How to use SetFMGlobal
malcolm at notyourhomework.net
malcolm at notyourhomework.net
Tue May 10 21:10:40 MDT 2011
OK, I can do that.
1. use postcode to search
2. get results
3. if there is a optional range present, do the maths and generate a
new search
4. get results
5. print the list
I was allured by the prospect of FX being able to handle it all in one
request.
Malcolm
Quoting Dale Bengston <dale.bengston at gmail.com>:
> Hi Malcolm,
>
> I'll start with my standard advice: you're developing a web app, so
> think like a web developer, rather than a FileMaker developer.
> Consider how to move both these queries into the PHP layer instead
> of using globals and FMP scripts to accomplish the second part.
>
> Hope this helps,
> Dale
>
> --
> Dale Bengston
> Streamline Studio, LLC
> www.streamline-studio.com
>
>
> On May 10, 2011, at 9:38 PM, malcolm at notyourhomework.net wrote:
>
>> Let me describe what I want to do, perhaps there is a better method.
>>
>> I want to pass data from the web to the script. There are two
>> items, a postcode which is used as the basis for search and a
>> number which is the distance to extend the search range.
>>
>> 1. user provides postcode and optional extra distance
>> 2. On the filemaker side.
>> 1. Search by postcode
>> 2. If the option "extend by distance" is present then set the
>> global field to that value and run a script, which uses the global
>> to perform a find which extends the range, and possibly the found set
>> 4. return records
>>
>> The thing that I want to achieve is pass transitory data from the
>> web to FMP. I have no interest in the global persisting.
>>
>> Malcolm
>>
>>
>> On 11/05/2011, at 12:54 AM, Ness, David wrote:
>>
>>> Globals are unique to the user, and each call to fx.php is a
>>> unique user incident, so you must reset globals on each fx
>>> ‘transaction’.
>>>
>>> (I think this is right unless I’m wrong.)
>>>
>>>
>>> David Allen Ness
>>> Database Systems Administrator
>>> Web Applications Developer
>>>
>>> <image001.gif>
>>>
>>> From: fx.php_list-bounces at mail.iviking.org
>>> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jon
>>> Montgomery
>>> Sent: Tuesday, May 10, 2011 10:52 AM
>>> To: FX.php Discussion List
>>> Subject: Re: [FX.php List] How to use SetFMGlobal
>>>
>>> Malcolm,
>>>
>>> Globals do not work to well on the web. It has been a long while
>>> since I tried using one. It did not work and many people have
>>> told me that they just do not work on the web. I found ways
>>> around it to do the same thing.
>>>
>>> Sorry that I do not remember all the technical ways of explaining
>>> it, but the global is always reset to its default value with each
>>> call to the database the global you would set via the web will
>>> disappear right with each call to the database via the web.
>>>
>>> Not a very well explained/written explanation but that is the way
>>> I understand it.
>>>
>>> HTH
>>>
>>> Jon Montgomery
>>>
>>>
>>> On May 10, 2011, at 9:31 AM, Bob Patin wrote:
>>>
>>>
>>> Malcolm,
>>>
>>> I've not used that function, but I would guess, as with all of the
>>> FX functions, that it's fairly straightforward.
>>>
>>> Do you have the global on your web layout? If not, there's your problem.
>>>
>>> After you set the field, try echoing an error message:
>>>
>>> echo $queryResult['errorCode'];
>>>
>>> If it's a 102 error then the field isn't on the web layout;
>>> anything other than a 0 means something's amiss.
>>>
>>> HTH,
>>>
>>>
>>> Bob Patin
>>> Longterm Solutions
>>> bob at longtermsolutions.com
>>> 615-333-6858
>>> http://www.longtermsolutions.com
>>> iChat: bobpatin
>>> FileMaker 9, 10 & 11 Certified Developer
>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>> --
>>> Expert FileMaker Consulting
>>> FileMaker Hosting for all versions of FileMaker
>>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>>> :
>>>
>>> On May 10, 2011, at 3:37 AM, Malcolm Fitzgerald wrote:
>>>
>>>
>>> I'm new to FX.php
>>>
>>> I can obtain results from my database on a simple search. Now I
>>> would like to extend the results by performing a script which
>>> relies on a global field. Whenever I include SetFMGlobal I don't
>>> get a result. If I comment out the line I do get a result, though
>>> my script returns the wrong set because the global is empty.
>>>
>>> Any hints appreciated.
>>>
>>> Malcolm_______________________________________________
>>> 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
>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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