[FX.php List] Problems with showing rangeStart/ rangeEnd of afoundCount

Allyson Olm allyson at fmwebschool.com
Mon Dec 5 09:51:23 MST 2005


Hi Lars,

I sometimes use a script like this to determine where the user is in the
record set.  This can be adapted to suit your particular situation.

This assumes that $skipsize and $groupsize are set before the actual
database query where $skipsize is the number of records being skipped and
$groupsize is the number of records to be returned in the set.

Showing <?php if($skipsize<=0){ echo '1'; }else{ echo $skipsize+1; } ?>
through <?php if(($skipsize+$groupsize)<$searchResult['foundCount']){  echo
$skipsize+$groupsize; }else{ echo $searchResult['foundCount']; } ?> of <?
echo $searchResult['foundCount']; ?> records.


In kindness,
Allyson Olm
FMWebschool
http://www.fmwebschool.com
Learn FX.php in 8 Hours 
http://www.fmwebschool.com/php8.htm

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Lars Arl é r
Sent: Monday, December 05, 2005 10:49 AM
To: FX.php Discussion List
Subject: [FX.php List] Problems with showing rangeStart/ rangeEnd of
afoundCount

Hey and thanks in advance.  ;-)

I am getting futher in my quest in transforming my CDML to PHP but ned som
help or direction in solving this range issue. I am a newbee and fighting to
learn FX.php and PHP. So sorry if this is bacic knowlege !!!

I am trying to show my Db info like this

"Showing 1 to 20 of 46 records"
And when skiping 20 records
"showing 21 to 40 of 46 records"
And so forth
"showing 41 to 46 of 46 records"


I have tryed to use this code, but only 'foundCount' showsup.


---------zip---------
Showing from
<? echo $searchResult['rangeStart']; ?> to <? echo
$searchResult['rangeEnd']; ?> of <? echo $searchResult['foundCount']; ?>
---------zip---------


Thanks again

Lars Arlér




_______________________________________________
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