[FX.php List] simple find in FM7 with Related fields
Dale Bengston
dbengston at preservationstudio.com
Thu Apr 21 08:55:49 MDT 2005
Hi Jane,
It looks like FX.php is failing to return results to your page, so the
foreach has no array to tick through. What do you see when you put
print_r($searchResult) in your page, after the FX call?
Also, why are you specifying a search parameter...
$search->AddDBParam('LastName',$LastName);
...in a FMfindall() query?
On Apr 20, 2005, at 5:45 PM, Jane Chinn wrote:
>
> Hi,
>
> When using FM Server 7 and a database with related fields contained in
> another FM7 Db and a page that does a test search(see php page below):
> I get an error which is:
> Warning: Cannot use a scalar value as an array in
> /Library/WebServer/Documents/forgetest/search_results.php on line 21
>
> Warning: Invalid argument supplied for foreach() in
> /Library/WebServer/Documents/forgetest/search_results.php on line 21
> LastName:
>
>
> <?php
> include_once('../FX/FX.php');
> include_once('../FX/FMErrors.php');
> include_once('../FX/server_data.php');
>
> $LastName=$_POST['LastName'];
>
> $groupSize='1';
>
> $search=new FX($serverIP,$portNumber,'FMPro7');
> $search->SetDBData('peer_roster.fp7','Layout1',$groupSize);
> $search->AddDBParam('LastName',$LastName);
>
> $searchResult=$search->FMFindall();
>
> echo $searchResult['errorCode'];
> foreach($searchResult['data'] as $key=>$searchData);
>
> ?>
> <html>
> <head>
> </head>
> <body>
>
> LastName: <? echo $searchData['LastName'][0]; ?>
> </body>
> </html>
>
> Does anyone know what causes this and how to fix it. The relationship
> (LastName) is is actually in another database not in the one being
> searched. This same simple search of another database with the same
> field name is not a problem.
>
> Thanks,
> Jane _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2034 bytes
Desc: not available
Url : http://www.iviking.org/pipermail/fx.php_list/attachments/20050421/491823b1/attachment.bin
More information about the FX.php_List
mailing list