There may be a better way of achieving the desired result but try this...
let me know if you need any further explanation of the code:
// get all the distinct date values from the tables (in this case it is colors)
$query = "select distinct (date) from colours";
$query_result = mysql_query_exec($db_handle, $query, true);
// for each row of the results above run another query to get all the
// records for each date coming out, basically running a query for each unique
// date in your table
while ($array_of_dates = mysql_fetch_array($query_result))
{
// build a query to get all the records based upon the date taken
// from the results of the previous query
$date_query = "select * from colours where date = '$array_of_dates[date]'";
$date_query_result = mysql_query_exec($db_handle, $date_query, true);
// set i to 0s
$i = 0;
// now loop around the results of the second query
while ($all_date_info_array = mysql_fetch_array($date_query_result))
{
// check if $i is 0, if it is then output the date
// if it is not 0 then do not output the date
// $i is always 0 on the first time round so here we
// only echoing the date out once
if ($i == 0)
{
echo "<b>" . $all_date_info_array[date] . "</b>";
}
// then echo out any other fields taken from the above query
echo "<font color = red><br>" . $all_date_info_array[name] . "</font><p>";
// increment $i by one so the date is not echoed out again
$i++;
}
}