You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PROJET-WEB_STRI1A/WEB/ressources/ville.php

11 lines
441 B
PHP

<?php
require_once ('../connexionBD.php');
//Envoyer en json les villes correspondantes au champ de saisie pour les villes
if (isset($_GET['search'])){
$ville = strtolower(htmlentities(pg_escape_string ($_GET['search'])));
$result = pg_query_params($db, "SELECT codepostal, nomville FROM ville WHERE lower(nomVille) like lower($1);", array("%$ville%"));
$return_arr = pg_fetch_all($result);
echo json_encode($return_arr);
}