11 lines
441 B
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);
|
||
|
}
|