Re: arrays() current() next() who to use

From: Date: Fri, 20 Aug 2004 00:28:19 +0000
Subject: Re: arrays() current() next() who to use
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194296@lists.php.net to get a copy of this message
* Thus wrote Vern: > I'm setting up an array based on recordset that does a loop as follows: > > do { > //SET ARRAYS > $z['username'][$k] = $row_rsUSERIDID['uname']; > $z['distance'][$k++] = $totaldist; > } while ($row_rsUSERIDID = mysql_fetch_assoc($rsUSERIDID)); > >... > > How can I now get this output displyed in groups of 10 so that I can display > them 10 at a time on a page then click a next button to dispaly they next 10 > and so forth? Well, this is the hard way to do things, and very inefficient but: foreach(array_slice($z['distance'], $start, 10) { //... } Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid!

« previous php.general (#194296) next »