Return to Snippet

Revision: 8429
at September 20, 2008 18:54 by davidsword


Initial Code
$query = "SELECT * FROM table";
$result = mysql_query($query);
$i = 1;
while($row = mysql_fetch_array($result)){
	if ($i % 2) {echo"<div style='background:#eaeaea;'>".$row['content']."</div>";}
	else {echo $row['content'];}
	$i++;
}

Initial URL
http://davidsword.ca/

Initial Description

                                

Initial Title
highlight even/odd list from database

Initial Tags

                                

Initial Language
PHP