'; print_r($row); echo''; $tempbez = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE tag='".$_POST['tag']."' and monat='".$_POST['monat']."' and jahr='".$_POST['jahr']."' ORDER BY tour"); $key=0; while($row = $tempbez->fetch_assoc()) { $tour=0; $tour=[$row['tour']]; $stat=" "; $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $stat=$a_touren[$ta_id]['tour']; $t[]=$tour; $s[]=$stat; $key++; } $back['t'] = $t; $back['s'] = $s; $back['success'] = true; $back['length'] = $key; echo json_encode($back); ?>