Jared,
I'm not sure how you'd select what you require in only the sql statement, but you could try this:
<?
$host = 'your_host_name';
$user = 'your_user_name';
$pass = 'your_password';
$db = 'your_db_name';
$table = 'your_table_name';
mysql_connect($host, $user, $pass) or die("Cannot logon to server");
mysql_select_db($db) or die("Cannot select database");
$sql = 'select date, count(date) as count from $table group by date';
$result = mysql_query($sql) or die("Unable to perform query");
$return_rows = mysql_fetch_array($result) or die("Unable to cenvert results to usable format");
$max_count = 0;
$max_date = '';
do
{
echo "Date: $return_rows[date] Count: $return_rows[count]<br>";
if ($max_count < $return_rows[count])
{
$max_count = $return_rows[count];
$max_date = $return_rows[date];
}
}
while ($return_rows = mysql_fetch_array($result));
echo "<br>With a count of $max_count, the date $max_date has the greatest number of entries in this table.";
?>
This script makes the assumption that no date will have the same number of entries, but it shouldn't be too hard to hack it a bit more to allow for this. Hope this helps!!!
Cheers,
Geoff