Jump to content

[SOLVED] PHP List, different colors


daveoffy

Recommended Posts

$get_rows = mysql_query("SELECT * FROM `list_of_things`");

$i = 0;
while($row = mysql_fetch_assoc($get_rows)){
     if($i % 2 == 0){
          $bg_color = 'light-grey';
     } else {
          $bg_color = 'grey';
     }

     //echo information you want displayed

     $i++;
}

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.