You can get it by using a if/else if/else
which will
will help first to verify the value of the variable that is
arriving so that later you pass said variable to the body of the
consult and execute the same
if it is by the method GET;
$ciudad = $_GET['ciudad'];
or if it is by the method POST;
$ciudad = $_POST['ciudad'];
if($ciudad === 1){
$ciudad = 'Mexico';
$query = "SELECT * FROM pais WHERE ciudad = .'$ciudad'."
}else if($ciudad === 2){
$ciudad = 'Bogota';
$query = "SELECT * FROM pais WHERE ciudad = .'$ciudad'."
}else{
$ciudad = 'Madrid';
$query = "SELECT * FROM pais WHERE ciudad = .'$ciudad'."
}
You can extend this chain of if, else if as many times as
you need