[FX.php List] simple find in FM7 with Related fields
Jane Chinn
Jane.Chinn at cwu.EDU
Thu Apr 21 09:31:36 MDT 2005
Thanks all for you explanations. There seems to be a consensus
regarding related fields in a database when there are no records. That
didn't seem to have been the problem. It was simply my not setting up
the fmsadmin to have full access. Anyway when I made that change I
didn't get the error. I will definitely keep this information in mind
as the databases I am currently working with have relationships.
Actually the login database doesn't have any related fields but the
second one is supposed to receive values from the login in database as
a relationship. That was how I had set it up before for CDML but now
I'm not sure I really need the username and student ID (password) to be
related fields in the main database.
Jane
On Apr 20, 2005, at 4:12 PM, Craig Forster wrote:
> Hi Jane.
>
> Ive seen this error a lot in the last few months, and wondered the
> same thing...
> For me the error seems sporadic (come up on some searches and not on
> others) so that led me to believe the php code ive written is fine,
> but the issue is in the database...
>
> Two things I’d check
>
> • the layout doesn’t contain any fields that no longer exist (fields
> you have deleted)
> • That there is a related record. Sometimes with a 1-1
> relationship, having no related record can cause this. I fixed this
> yesterday with the addition of a –script.presort parameter ( the
> filemaker script simply said If relatedTable::somefield=”” then set it
> to “ “). This was enough to create a related record when there wasn’t
> any present...
>
>
> Your php addition now looks like this :
>
> $search=new FX($serverIP,$portNumber,'FMPro7');
> $search->SetDBData('peer_roster.fp7','Layout1',$groupSize);
> $search->AddDBParam('LastName',$LastName);
> $search->AddDBParam(‘-script.presort’ ,
> ’filemaker_script_name_case_senstive’)
>
> Hope this helps,
> Craig
>
> --
>
> Craig Forster
> Software Designer
> Particle Systems,
> Christchurch,
> New Zealand
>
>
>
>
> On 21/4/05 10:45 AM, "Jane Chinn" <Jane.Chinn at cwu.EDU> 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
>
>
> _______________________________________________
> 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: 6619 bytes
Desc: not available
Url : http://www.iviking.org/pipermail/fx.php_list/attachments/20050421/0dca8abc/attachment-0001.bin
More information about the FX.php_List
mailing list