Listing 4. The whole system consists of only a single search.php file. Cities Search
Search for: ">

prepare($query); $searchFor = "%".$_REQUEST["searchFor"]."%"; $stmt->bind_param("s", $searchFor); $stmt->execute(); $result = $stmt->get_result(); echo ""; foreach ($result->fetch_all(MYSQLI_NUM) as $row) { echo ""; foreach($row as $data) { echo ""; } echo ""; } echo "
CountryCityLatLong
".$data."
"; } catch (Exception $e) { echo "Exception " . $e->getMessage(); } } ?>