SELECT COUNT(DISTINCT(t.id)) as nb, v.gps_x, v.gps_y FROM terrains as t, ville as v WHERE t.id_ville = v.id AND t.id_ville = ?ArraySELECT DISTINCT(t.id) as id,
t.titre as nomterrain,
t.date as dateterrain,
t.photo1 as photo1,
t.prix as prix,
t.superficie as superficie,
v.ville as ville,
t.type as type,
t.viabilise as viabilise,
v.cp as cp,
t.id_pros,
t.photo2 as photo2,
t.photo3 as photo3,
t.photo4 as photo4,
t.photo5 as photo5,
v.gps_y,
v.gps_x,
t.avec_maison,
t.nombre_piece,
t.nombre_chambre,
t.nombre_sdb,
t.nombre_etage,
t.garage,
t.surface_maison,
t.description FROM terrains as t, ville as v WHERE t.id_ville = v.id AND t.id_ville = ?