Mysql multi query with group
$sql = "SELECT
l.DATE
,SUM(CASE WHEN l.SOURCE = 'mail' THEN 1 ELSE 0 END) AS SOURCE_MAIL
,SUM(CASE WHEN l.SOURCE = 'phone' THEN 1 ELSE 0 END) AS SOURCE_PHONE
,SUM(CASE WHEN l.SOURCE = 'direct' THEN 1 ELSE 0 END) AS SOURCE_DIRECT
,SUM(CASE WHEN l.SOURCE = 'external' THEN 1 ELSE 0 END) AS SOURCE_EXTERNAL
FROM LEADZ AS l
GROUP BY l.DATE";
$result = mysqli_query($link,$sql);
while($r = mysqli_fetch_array($result)) {
extract($r);
echo $DATE.'<BR>'.
'mail: '$SOURCE_MAIL.'<BR>'.
'phone: '$SOURCE_PHONE.'<BR>'.
'direct: '$SOURCE_DIRECT.'<BR>'.
'external: '$SOURCE_EXTERNAL.'<BR><hr>';
}