[FX.php List] Difference in code syntax

VanBuskirk, Patricia pvanbuskirk at otc.fsu.edu
Fri Jun 5 09:19:00 MDT 2009


Thanks Bob!

I have been using the format of the second example on each and they work
... just the other syntax and language threw me off, i.e. the use of
brackets around the call and no [0] at the end of it... and the term
DoFXAction(...).

I appreciate your reply!

Trish


-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Bob Patin
Sent: Friday, June 05, 2009 10:52 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] Difference in code syntax



On Jun 5, 2009, at 9:40 AM, VanBuskirk, Patricia wrote:

> Can someone explain the difference between the following...
>
>
>     $deptList = $deptListQuery->DoFXAction(FX_ACTION_FINDALL);
>
>                  OR
>
>     $deptList = $deptListQuery->FMFind();
>
I've never used that first one, but at first glance, it appears to do  
a FindAll instead of a FIND; the 2nd one does a FIND; you'd typically  
include one or more find criteria with it, like this:

$deptListQuery->AddDBParam('myfield',$searchvalue);
$deptListQuery->AddDBParam('my2ndfield',$searchvalue2);
$deptListResult = $deptListQuery->FMFind();

If you're doing a FindAll, just change the last line to read  
FMFindAll() instead, and don't put in any search criteria.

Another thing to keep in mind is to specify how large you want your  
search results to be; if you don't put anything, the default is 50; if  
you want to see all results, put 'all', like this:

$query =new FX($serverIP,$webCompanionPort, $dataType, $scheme);
$query->SetDBData($dbname,'web_session','All');
$query->SetDBPassword($mypassword,$myusername);
$queryResults = $query->FMFindAll();

When you want to see the results of your query, you need the 2nd  
dimension of the array, like this:

foreach($queryResults[] as $key=>$queryData){
	$name = $queryData['name'][0];
	$address = $queryData['address'][0];
}

HTH,

Bob Patin
Longterm Solutions
P.O. Box 3408
Brentwood, TN 37024
615-333-6858
bob at longtermsolutions.com
http://www.longtermsolutions.com
iChat: bobpatin
AIM: longterm1954
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP * Full email services * Free DNS hosting * Colocation * Consulting


>
>     {$Listing['PrintOrder']}
>
> 		OR
>
> 	$Listing['PrintLine'] [0]
>
>
> I am trying to copy code from someone else and it is confusing me!
>
> Thanks!
> Trish
> _______________________________________________
> 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