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


Groups > comp.lang.php > #16832

Re: Limit "most popular" to 100

Path csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.php
Subject Re: Limit "most popular" to 100
Date Wed, 6 Jul 2016 14:02:51 +0200
Organization solani.org
Lines 21
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>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace solani.org 1467806569 32677 eJwFwQENADAIAzBLcNjG5Twk8y/hLYrJVRNsGL5eCWSGMma2Hqdxbqe243LEPuEHK2zUB/J/D5w= (6 Jul 2016 12:02:49 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Wed, 6 Jul 2016 12:02:49 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
X-User-ID eJwNwQEBACAIA7BKIPJDHBXsH0E3NygOJxzT71/FFmvLs1E22CEfsfYdRxChJdotGUzlehkzEJ8=
In-Reply-To <super70s-4AE521.22324705072016@boina.datemas.de>
Cancel-Lock sha1:EUpmE/33sphNGApQlEmVQymyR0c=
X-NNTP-Posting-Host eJwFwYEBwDAEBMCVIvj6cRD2H6F3rhD0Z3CYr2/FpMZUDS/FNll50P1e2tFsZ0VdCHmje/gDOwMR9w==
Xref csiph.com comp.lang.php:16832

Show key headers only | 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