<?php

// $status = array("Offen", "in Bearbeitung", "Erledigt");
$task_group_id = 0;
if(isset($_GET['group_id'])){
    $task_group_id = $_GET['task_group_id'];
}

$query = "SELECT * FROM tasks WHERE main_contact_id = ".$GLOBALS['main_contact']['id'] . " AND task_group_id = ".$task_group_id;
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
while($row = @mysqli_fetch_array($result)){
    echo $row['title'];
}