$number = mysql_query("SELECT COUNT(*), task_type FROM dotp_tasks WHERE (task_type = '$key') AND (task_project in (". join(',',$with_type) .")) AND (task_id in (" . join(',',$UsrTasks) . "))");
"SELECT COUNT(*), task_type
FROM dotp_tasks
WHERE task_type = '$key'
AND task_project in ('". join("','", $with_type) ."')
AND task_id in (" . join(',',$UsrTasks) . ")"