Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread John Holmes
From: Vern [EMAIL PROTECTED] 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? Can't you do all that sorting in your query so you can just retrieve 10 rows at a time

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Vern
Problem with that is it sorts according the results of the recordset range. For instance: It will show the user 1 trhough 10 sorted by miles then 20 - 30 sorted by miles, however, in 1 through 10 could have a range of 0 to 1000 miles and the next set will have 5 to 200 miles. What I need is to

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Torsten Roehr
Vern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Problem with that is it sorts according the results of the recordset range. For instance: It will show the user 1 trhough 10 sorted by miles then 20 - 30 sorted by miles, however, in 1 through 10 could have a range of 0 to 1000

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Vern
The miles are being caluculated during the loop that is created using the recordset not in the database. First I create a do..while loop to get the miles do { $k = 0; //SET FIRST ARRAY OF ONLINE USERS AND CALCULATE MILES do { //GEOZIP $zip2 = $row_rsUSERIDID['zip'];

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Curt Zirzow
* 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

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Vern
Well, this is the hard way to do things, and very inefficient but: foreach(array_slice($z['distance'], $start, 10) { //... } If you think there's a better way of doing it I would like to hear it. However this is resulting in an Parse error on the foreach line:

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Michal Migurski
If you think there's a better way of doing it I would like to hear it. However this is resulting in an Parse error on the foreach line: foreach(array_slice($z['distance'], $start, 10)) { $newuser = $z['user'][$k]; echo $newuser . - . $v . br; } foreach needs an as, probably