Alright, i've spent wayyy to much time figuring this one out and nothing has been solved yet. I'm creating a simple database that tracks when people were certified for various skills, and depending on how old the certification is the cell's background color changes. [code] $Water = mysql_query("SELECT blowout,boat_ent,contact_res,crew_pick,resc_board,swim_tend,swim,self_resc,tether_swim,victim_stab,wading FROM c_water WHERE id = $Person[id]"); $Water = mysql_fetch_array($Water); foreach($Water as $i) { $Now = time(); $Lapsed = $Now - $i; if($i == 0) { // if no date is entered, run me $Temp = "<td bgcolor=\"#FF0000\">test</td>"; } elseif($Lapsed <= 31535999) { //white $Temp = "<td bgcolor=\"#FFFFFF\">" . date('m/d/Y', $i) . "</td>"; } elseif($Lapsed <= 63071999) { //green $Temp = "<td bgcolor=\"#00DD00\">" . date('m/d/Y', $i) . "</td>"; } elseif($Lapsed <= 94607999) { //yellow $Temp = "<td bgcolor=\"#FFFF00\">" . date('m/d/Y', $i) . "</td>"; } elseif($Lapsed >= 94607999) { //red $Temp = "<td bgcolor=\"#FF0000\">" . date('m/d/Y', $i) . "</td>"; } echo $Temp; } [/code] The script works as it should. It goes through each value in the array that it got from the database, checks how old it is, changes it to a readable format, and displays it. That stuff works fine. The part that doesnt work fine is that for whatever elseif conditional is chosen, it runs twice. For example, if the date is old enough to be considered 'yellow' (as commented in the code) then that string is echo'd twice. If it's red, that goes twice. I've linked a screenshot of the output so you can get an idea of what i'm talking about: [a href=\"http://img20.imageshack.us/img20/6197/ugh5gy.jpg\" target=\"_blank\"]http://img20.imageshack.us/img20/6197/ugh5gy.jpg[/a] As you can see, all the colors and dates are in blocks of two. I hope i've explained this well enough for you, now what am I doing wrong? Why are the strings being displayed twice? I beg for your help! :)