[FX.php List] Difference in code syntax
Bob Patin
bob at patin.com
Fri Jun 5 08:51:43 MDT 2009
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
More information about the FX.php_List
mailing list