Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16832

Re: Limit "most popular" to 100

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.php
Subject Re: Limit "most popular" to 100
Date 2016-07-06 14:02 +0200
Organization solani.org
Message-ID <nlis19$vt5$2@solani.org> (permalink)
References <super70s-BB47CD.10383304072016@boina.datemas.de> <fQvez.67639$F_5.10789@fx23.iad> <super70s-4AE521.22324705072016@boina.datemas.de>

Show all headers | View raw


On 06.07.2016 at 05:32, super70s wrote:

> In article <fQvez.67639$F_5.10789@fx23.iad>,
>  Richard Damon <Richard@Damon-Family.org> wrote:
> 
>> You could do a php only solution, adding a counter to the loop. 
>> Something similar to:
>>
>> <?$cnt=0;
>> while (++$cnt<=100 && $rshome = mysql_fetch_array($cmdartcat)) { ?>
> 
> That seems to have done the trick! Much obliged.
> 
> I just didn't want the page to get really huge by displaying all the 
> posts in the db.

Good thinking.  However, why do you retrieve all posts from the DB then
in the first place?

-- 
Christoph M. Becker

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Limit "most popular" to 100 super70s <super70s@super70s.invalid> - 2016-07-04 10:38 -0500
  Re: Limit "most popular" to 100 Richard Damon <Richard@Damon-Family.org> - 2016-07-04 09:06 -0700
    Re: Limit "most popular" to 100 "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-04 18:11 +0200
    Re: Limit "most popular" to 100 super70s <super70s@super70s.invalid> - 2016-07-05 22:32 -0500
      Re: Limit "most popular" to 100 "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-06 14:02 +0200

csiph-web