Try
$sql = "SELECT account_id, email_id, COUNT(*) as total
FROM mytable
GROUP BY account_id, email_id
HAVING total > 3";
$res = mysql_query($sql);
if (list($account, $email, $total) = mysql_fetch_row($res))
{
do {
echo "$account<br>";
} while (list($account, $email, $total) = mysql_fetch_row($res));
}
else {
echo "No accounts with more than 3 orders<br>";
}