[FX.php List] foundCount and more

DC unprotectedlist at dbmscan.com
Wed Feb 9 12:37:45 MST 2005


i haven't used FMSkipRecords() in FX.php but that should help you.

In FMP6 with FX.php when you do a search and pass a limiting value to

$result=SetDBData($db,$layout,'25');

... for example, you'll get 25 records back (if there are more than 25) 
and the $result array will have the foundCount at:

$total_number_of_records_found=$result['foundCount']; // case sensitive

This alone gives you a 'data' array with the first 25 records in it 
(depending on sort order) and a 'foundCount' that has the total of all 
records matching your find request.

Add FMSkipRecords('25') before your find and you'll get the next 25 
records, and so on in multiples of 25 (or however many you want to see 
on the page at a time).

If you need something in native PHP, have a look at the array_slice() 
function in PHP. using that function you can get all records at once 
into FX.php and then just pull out a subsection of an array.

in both approaches, as Denny said, you'll have to track the details and 
counts in a session/cookie(recommended) or pass it in your URL (not 
recommended).

to get you going with keeping variables in session/cookies look at 
session_start() and the $_SESSION superglobal variable. e.g.,
$_SESSION['yourpagenumbervariablehere'] variable.

buena suerte,
dan

Dennis Crall had written:
> Lyn,
> 
> I don't believe that FX.php returns the information for which you are
> looking. FX's function SetDBData does take a $groupSize parameter allowing
> you to retrieve data in batches. However, you will have to pass and track
> this information with your requests or save it in a cookie I
> 
> Good luck,
> 
> Denny
> 
> 
> On 2/5/05 8:43 PM, "L.M.Loeffel" <Lynn at turnkeydesign.net> wrote:
> 
> 
>>  I'm having trouble getting messages to the list. I hope this one makes
>>it.
>>
>>My question has to do with foundCount and related fields.
>>
>>I know that if I want to say:
>>
>>"The total number of records that match this search is XXXX" foundCount
>>will provide me with the number.
>>
>>However, I can't figure out how to get fx.php to return the number of
>>records displayed on a certain page.
>>
>>For example, I want to say:
>>
>>Shown below are records number 1 through 20 of 236 records. (236 being
>>my fictional foundCount number)
>>Shown below are records number 21 through 40 of 236 records.
>>
>>How do I do this?
>>
>>Thank you!
>>-Lynn, the FX.php newbie
>>
>>_______________________________________________
>>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
> 


More information about the FX.php_List mailing list