<?php
$selectvalue = $_POST['allselect'];
$query = "SELECT * FROM hos_detail WHERE HOS_CITY like '$selectvalue'";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result)){
echo $row['HOS_NAME'];
}
?>
發現自己的錯誤了