<?php
session_start();
require_once('../conexion.php');
$datos = mysqli_query($api,"SELECT * from municipalities where department_id=$_GET[departamento] ");
$count  = mysqli_num_rows($datos);
if($count == null) 
{
	print "<option value=''>-- NO HAY DATOS --</option>";
}
else
{
    while ($fila = mysqli_fetch_assoc($datos))
    {
        print' <option value="'.$fila['id'].'">'.$fila['name'].'</option>';
    }
}
?>