On Tuesday 27 January 2004 17:13, Ricardo Lopes wrote: > It isnt pretty, efficient or small, but it works... :) Try this: $c= (++$ZZ%2? 'yellow':'white'); printf("<tr bgcolor=\"$c\">"); > > ----- Original Message ----- > From: "Gary Every" <Gary.Every@xxxxxxxxxxxxxxxxxxxxxxx> > To: "Ryan Jameson (USA)" <RJameson@xxxxxxxxxxx>; <php-db@xxxxxxxxxxxxx> > Sent: Tuesday, January 27, 2004 4:13 PM > Subject: RE: Results with ledger stripes? > > > Haven't been following this thread, but here's how we do it: > > If($bgc == '') { > $bgc = "#DDDDDD"; > } elseif($bgc == "#FFFFFF") { > $bgc = "#DDDDDD"; > } else { > $bgc = "#FFFFFF"; > } > > > > Gary Every > Sr. UNIX Administrator > Ingram Entertainment Inc. > 2 Ingram Blvd, La Vergne, TN 37089 > "Pay It Forward!" > > -----Original Message----- > From: Ryan Jameson (USA) [mailto:RJameson@xxxxxxxxxxx] > Sent: Monday, January 26, 2004 12:00 PM > To: php-db@xxxxxxxxxxxxx > Subject: RE: Results with ledger stripes? > > $bg1 = "#dddddd"; > $bg2 = "#ffffff"; > While ... > $bg3 = $bg2; > $bg2 = $bg1; > $bg1 = $bg3; > echo "<tr bgcolor='$bg1'> .... > > Makes sense? > > <>< Ryan > > -----Original Message----- > From: dan@xxxxxxxxxxxxxxxx [mailto:dan@xxxxxxxxxxxxxxxx] > Sent: Sunday, January 25, 2004 6:43 PM > To: php-db@xxxxxxxxxxxxx > Subject: Results with ledger stripes? > > Hello all, > > I'm in the midst of creating an internet speed test system thingamabob > for my website. It's basically finished...but ugly as sin. What I'd > like to do is have the results (an average of each domain tested) listed > in a nice pretty table with alternating background colors, kinda like a > ledger. How on earth do I do this? > > Here's what I've got thus far: > > <?php > echo "Average speeds of each domain tested:<br>"; $mongo = @mysql_query > ("SELECT > substring_index(name,'.',-2),ROUND(AVG(speed),1) FROM `readings` GROUP > BY > substring_index(name,'.',-2) ORDER BY substring_index(name,'.',-2) > ASC"); echo "<table><tr><td>Domain</td><td>Average Speed</td></tr>\n"; > while ($mongorow = mysql_fetch_array($mongo, MYSQL_NUM)) { echo > "<tr><td>$mongorow[0]</td><td>$mongorow[1]</td></tr>\n";} > echo "</table>"; > ?> > > And I'd like it to spit out something along these lines: > <table> > <tr bgcolor=#dddddd><td>domain1.com</td><td>666.6 kbps</td></tr> <tr > bgcolor=#ffffff><td>domain2.com</td><td>3000.0 kbps</td></tr> repeat > until done </table> > > The gizmo is up and running at > http://www.dibcomputers.com/bandwidthmeter/index.php if you care to have > a gander. > Thanks a bunch, > Dan > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Jim Hatridge Linux User #88484 ------------------------------------------------------ BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer WartHog Bulletin Info about new German Stamps http://www.fuzzybunnymilitia.org/~hatridge/bulletin Viel Feind -- Viel Ehr' Anti-US Propaganda stamp collection http://www.fuzzybunnymilitia.org/~hatridge/collection -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php