I'm making a table off results from a mySQL database, to make the table more readable i'm trying to make every other row light grey while the others are white.. I'm only using mysql_fetch_array to get the data... can anyone help me please?
$color = 'white'; while (/* condition */) { $color = $color == 'grey' ? 'white' : 'grey'; echo $color; } PHP:
I've been looking for this too, and excuse the amateur question, but what goes here? /* condition */ PHP: Could I have an example? Thanks! -Peter
Your loop condition. Usually something like: (when looping through a table) while ($row = mysql_fetch_array($query)) PHP: