Jump to content

[SOLVED] Making something echo for every other in a LOOP


dsaba

Recommended Posts

hello!

 

normally i am echoing data from my database in a while statement:

while ($queryrow = mysql_fetch_array($query)) {

echo 'some data';

}

 

It everything in those brackets always echoes the same for each iteration of that loop

 

I wanted to do something like here in the SMF forums that when it shows replies to a topic, every other reply is in a different color background, blue and light blue

 

This means it will echo one kind of data every other time in the loop.

 

How can I do that with a while statement, or perhaps another kind of loop?

 

-thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.