Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $comarca = $_GET['comarca'];
- $conexion = new mysqli("localhost", "root", "", "cadiz");
- $conexion->query("set names utf8");
- $sql = "select * from municipio where comarca_id = $comarca order by nombre";
- $resultado = $conexion->query($sql);
- echo json_encode($resultado->fetch_all(MYSQLI_ASSOC));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement