[FX.php List] FoundCount FMAS 7 vs FM 6
Dale Bengston
dbengston at preservationstudio.com
Tue Nov 15 20:31:04 MST 2005
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
More information about the FX.php_List
mailing list