sorting odd's and even's
Posted: Wed Nov 07, 2007 10:46 pm
Hey Guys,
I have a SELECT statement that pulls out all the data from a table. How would I code it so that all the rows with odd id numbers will show up with a different background color to those with even numbers.
eg.
I have a SELECT statement that pulls out all the data from a table. How would I code it so that all the rows with odd id numbers will show up with a different background color to those with even numbers.
eg.
Code: Select all
if (odd){
echo "<tr class='this'>"
}
else{
echo "<tr class='that'>"
}