- <html>
- <body>
- <?php
- $link = mysql_connect('localhost', 'root', '')
- OR die(mysql_error());
- mysql_select_db($teach);
- $sdfsdfsd = htmlspecialchars(trim($_POST['searchterm']));
- $query = mysql_query("Select * from users where city = '%".$sdfsdfsd."%'");
- while($res = mysql_fetch_array($query))
- {
- echo $res[id];
- echo $res[name];
- echo $res[city];
- }
- ?>
- </body>
- </html>