some ideas:
1.
use the DISTINCT keyword in your sql-query to eliminate duplicate rows:
SELECT DISTINCT Date FROM yourTable ....
btw.: you should change the row-name 'Date' to something different, if you can. it causes no problems in MySQL but other db's don't like that, because it's a type like 'text', 'blob' etc.
2.
use array_count_values(). see:
http://www.php.net/manual/en/function.array-count-values.php
$a = array("jan", "jan", "feb", "feb", "feb", "mar");
$b = array_count_values($a);
$b is now array("jan" => 2, "feb" => 3, "mar" => 1)
3.
try this:
$a = array("jan", "jan", "feb", "feb", "feb", "mar");
$b = array();
foreach ($a as $m) $b[$m] = $m;
$b is now array("jan" => "jan", "feb" => "feb", "mar" => "mar")
4.
$a = array("jan", "jan", "feb", "feb", "feb", "mar");
$b = array();
foreach ($a as $m)
$b[] = (!in_array($m, $b) ? $m : FALSE);
$b is now array("jan", , "feb", , , "mar");
hope that helps
joe