On Saturday 11 May 2002 02:45, Glenn Sieb wrote: > Hi everyone, > > I have a PHP script that reads data from an MS SQL server and outputs the > data into a table. I've been asked if I can alternate the colors of the > rows to make the report more legible. The relevant piece of code looks > like: > > for ($i = 0; $i < mssql_num_rows( $stmt ); ++$i) > { > $line = mssql_fetch_row($stmt); > print ("<TR><FONT > COLOR=#$color><TD>$line[2]</TD><TD>$line[0]</TD><TD>$line[3]</TD></TR>"); > } > > Is there a way for me to do one of the following: > > 1) Test to see if $i is an even or odd number?
if ($i % 2) { odd; } else { even; } -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* "I once witnessed a long-winded, month-long flamewar over the use of mice vs. trackballs...It was very silly." (By Matt Welsh) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php