I want to develop a simple website, It consists of a search form (text input and submit button) which are used to fetch data from a database. Under the form, i make some "map" using div tag that each of div tag represent location. If data was found, one of the div tag that represent the location of we've search before will change the style background-color.
here is my html
<html>
<head>
<title></title>
</head>
<body>
<div>
<form name='searhThings' method=GET action='<?php $_SERVER['PHP_SELF']; ?>' />
<input type='text' name='idX' />
<input type='submit' value='search' />
</form>
</div>
<div>
<p>Location:
<?php
include 'connection.php';
if ((isset($_GET['submit'])) AND ($_GET['search'] <> "")) {
$data = $_GET['search'];
$result = mysql_query("SELECT * FROM things WHERE ID_X = '$data'");
$row = mysql_fetch_array($result);
if ($row) {
# code...
$id_location = $row['LOCATION'];
echo $id_location;
} else {
# code...
echo "data not found";
}
}
?>
</p>
</div>
<div>
<div id='locationA'></div>
<div id='locationB'></div>
<div id='locationC'></div>
<div id='locationD'></div>
<div id='locationE'></div>
</div>
</body>
</html>
My question is what should i use to implement this?