Brad Ciszewski a écrit :

I am writing a web script where the background colors of certain rows change
when the amount of money changes.
For example, my first piece of data is 1.12. my second piece of data is
1.34, my third piece of data is 1.34, and my forth piece of data is 1.5.
They would like this on the webpage.
1.12 [light color]
1.34 [dark color]
1.34 [dark color]
1.5 [light color]
As you can see, when the amount of cash changes, the background color
What I am trying to do is figure out how to keep the old data from my last
while statement.

How can I do this? Any help is greatly appreciated.
That's really simple. Just keep track of the last data :

$last_data = 0;
while (...)
   if ($data != $last_data)
      $last_data = $data;
      $light_color = !$light_color;
   if ($light_color)
      echo "<font color=#eeeeee>.....";
      echo "<font color=#444444>.....";

Something like this....


Alain --

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to