salam
you can use in_array function
<?php
$dates=array("1072903820", "1072644366", "1072817338");
$starttime=1072385420;// my currend date
$endtime=$starttime+6*86400;
// 86400 seconds day, so for 7 days is 7*86400
for($time=$starttime;$time<=$endtime;$time=$time+86400){
if(in_array($time,$dates)){
$color="color =\"red\"";
}else{
$color="";
}
echo"<font $color>".date("d-m-Y","$time")."</font>=$time<br>\n";
}
?>
so put all the dates from mysql databse to into array and use in_array function