<?php
include "db.php";

$menu_id = $_GET['menu_id'];

$q = $conn->query("
SELECT * FROM radio_ads
WHERE menu_id='$menu_id' AND status=1
");

$ads = [];

while($row = $q->fetch_assoc()){
    $ads[] = $row;
}

echo json_encode($ads);