[FX.php List] How to use SetFMGlobal

Bob Patin bob at patin.com
Wed May 11 13:58:25 MDT 2011


Malcolm,

Don't hesitate to do more than 1 query on a page; I routinely have pages that do multiple queries. 

Without knowing what you're exactly trying to do, my suggestion would be to populate a record with whatever numbers you need, do the calculation in a calc field or auto-calc, and then re-query to return the results of the calc.

That way, you're letting FileMaker do the calc for you, and then pulling the result back to the PHP page.

For example, I have a site where I create an order (from session variable arrays).

Then I immediately get back the order# that was generated--this doesn't require a re-query since the act of creating the record will allow me to retrieve fields from the created record.

$queryResult = $query->FMNew(); // this could be a FIND as well if you wanted

// error code would go here...

foreach($queryResult['data'] as $key=>$queryData);
$order_number = $queryData['order_number'][0];

I could just as easily retrieve the value of a calc or auto-calc field, and then use it somehow on the web.

Hope this helps,


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 11, 2011, at 2:31 PM, malcolm at notyourhomework.net wrote:

>> And why shouldn't it?
>> 
>> if (isset($_REQUEST['Distance'])) {
>> 	//Do the maths and search
>> } else {
>> 	//Just do the PCode search
>> }
>> 
>> I'll note that so far I have never found something that required a Script rather than handling it in PHP - I'm sure there may be something, but I also like to keep the web layer totally seperate from the data layer
> 
> 
> The problem with this scenario is that the data required for doing the maths is in the database. I'm happy to do the maths but I need to get the data from Filemaker before I can do that. 
> 
> 
> 
> Malcolm
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20110511/a1a84f60/attachment-0001.html


More information about the FX.php_List mailing list