[thelist] RE: looping through output with PHP

jon steele jjsteele22 at yahoo.com
Wed Jul 11 11:06:49 CDT 2001


Hi John,

The results are stored in an array, so you can access them numerically,
like: $results[0], results[1], etc..

So if you're looping:

for($i=0;$i<=sizeof($results);$i+=2){
echo results[$i];
echo results[$i+1];
}

That'll output two values everytime the loop is run.

Jon.

From: "John Corry" <webshot at neoncowboy.com>
I've done simple database retrieval and display with PHP.

Now I want to get a little 'tricky'...but I'm having a hard time 
conceiving
the code that'll make it work...

Looping with while is easy...I just output each row from the DB into a 
row
in the HTML table output. cake.

So, how do I put <gasp> 2 rows of DB returns on one row of HTML output?


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




More information about the thelist mailing list