[FX.php List] FoundCount FMAS 7 vs FM 6

Andy Gaunt andy at fmpug.com
Wed Nov 16 07:41:25 MST 2005


Hi -

In the FX.PHP you will find a line for the found count

var $foundCount = -1;

Change this to 0 and you can then use your ['foundCount'] == 0

Otherwise you can use the FM error code 401 as Dale suggests

Andy Gaunt
T: 407.810.4722
andy at fmpug.com
http://www.fmpug.com
	
Recipient of FileMaker’s 2005 “Mad Dog” Public Relations Award
 
November 17th  2005, 6pm Orlando FMPug – FileMaker Pro Thanksgiving – Tips &
Tricks with FileMaker Pro 8.
For other chapter locations, dates & times please visit the website at
http://www.fmpug.com
If you can make it to a meeting, please RSVP at
http://www.fmpug.com/rsvp.php


-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Dale Bengston
Sent: Tuesday, November 15, 2005 10:31 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] FoundCount FMAS 7 vs FM 6

Hi Kim and Michael,

I use $search_results['errorCode']  = 401 to trap for no records found.

Hope this helps,
Dale

On Nov 15, 2005, at 5:27 PM, Michael Layne wrote:

> Kim,
>
> I haven't spent a ton of time finding out WHY, but I found the same  
> thing when I started to migrate my applications, and I did exactly  
> what you proposed, works fine.
>
> When I'm authenticating a user, I just use :
>
> if ($r['foundCount'] == 1) {
>     //all is fine
> } else {
>     // no user found...
> }
>
>
> otherwise:
>
> if ($r['foundCount'] <= 0) {
> ...
>
> On Nov 15, 2005, at 5:59 PM, Kim Hawksworth wrote:
>
>> I’m in the process of converting my FX.php applications from FM 6  
>> to FMAS 7.  I typically use the following code at the start of my   
>> search results pages:
>>
>>
>> <?php
>>
>> If ($search_results[‘foundCount’] == 0) {
>>
>> echo “No Results Found!”;
>>
>> }else{
>>
>> Display table of results;
>>
>> }
>>
>> ?>
>>
>> In FMSA 7 this returns an empty table of results instead of the  
>> “No Results Found!” statement.  If I put an echo $search_results 
>> [‘foundCount’]; statement on the page, FMSA 7 returns a  -1  
>> instead of 0 when it finds no records matching the search  
>> criteria.  Is there a way to force FMSA 7 to return 0 instead of -1?
>>
>> I suppose I could change the criteria of the if statement to  <=  
>> 0, however, this just doesn’t seem right.  Has anyone else come  
>> across this difference in the [‘foundCounts’] function between the  
>> two versions and what have you done as a workaround?
>>
>>
>> -- 
>> Kim D. Hawksworth, R.Ph., Web Manager
>> Department of Pharmacy
>> The Ohio State University Health System
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>
>
> Michael Layne  :  9 degrees development  :  www.9degrees.com  :   
> 404.226.7835
>
> _______________________________________________
> 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

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/173 - Release Date: 11/16/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/173 - Release Date: 11/16/2005
 



More information about the FX.php_List mailing list