selemet,
$sql = "select (select count(*) from `cms_mail` left join `cms_contact` on `cms_mail`.`user_id`=`cms_contact`.`from_id` and `cms_contact`.`user_id`='" . $user_id . "' where `cms_mail`.`from_id`='" . $user_id . "' and `cms_mail`.`sys`='0' and `cms_mail`.`delete`!=1 and `cms_contact`.`ban`!='1' and `spam`='0') as `m1`, (select count(*) from `cms_mail` left join `cms_contact` on `cms_mail`.`from_id`=`cms_contact`.`from_id` and `cms_contact`.`user_id`='" . $user_id . "' where `cms_mail`.`user_id`='" . $user_id . "' and `cms_mail`.`delete`!=1 and `cms_mail`.`sys`=0 and `cms_contact`.`ban`!=1) as `m2`, (select count(*) from `cms_mail` left join `cms_contact` on `cms_mail`.`user_id`=`cms_contact`.`from_id` and `cms_contact`.`user_id`='" . $user_id . "' where `cms_mail`.`from_id`='" . $user_id . "' and `cms_mail`.`sys`='0' and `cms_mail`.`read`='0' and `cms_mail`.`delete`!=1 and `cms_contact`.`ban`!='1' and `cms_mail`.`spam`='0') as `mnew`, `users`.`id` from `users` where `id` = '" . $user_id . "'";
$res = mysql_fetch_assoc(mysql_query($sql));
echo '<div>' . $res['m1'] . '</div>' .
'<div>' . $res['m2'] . '</div>' .
'<div>' . $res['mnew'] . '</div>';