$startdate = strftime("%Y-%m-%d %H:%M", $monday); $sunday = strtotime("+6 days", $monday); $enddate = strftime("%Y-%m-%d %H:%M", $sunday); $sql = "select *, unix_timestamp(received) as receivedepoch from calendar where received between '{$startdate}' and '{$enddate}' order by received"; $res = mysql_query($sql); while ($row = mysql_fetch_assoc($res)) { $date = strftime("%m/%d", $row["receivedepoch"]); $d = intval(strftime("%u", $row["received"])); $currentday = $row["received"]; print strftime("