Advertisement
Guest User

PHP Municipios

a guest
Dec 6th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. <?php
  2. $comarca = $_GET['comarca'];
  3. $conexion = new mysqli("localhost", "root", "", "cadiz");
  4. $conexion->query("set names utf8");
  5. $sql = "select * from municipio where comarca_id = $comarca order by nombre";
  6. $resultado = $conexion->query($sql);
  7. echo json_encode($resultado->fetch_all(MYSQLI_ASSOC));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement