So I'm kinda new to php. I've made a search but i'm looking for some help so that i can add more inputs and it will narrow the results down. for example i search "John" and 100 johns come up. But then i search "john" and then select Canada only 15 Johns come up. I have some code written for the single line search.
<?php
mysql_connect ("localhost", "root","root") or die (mysql_error());
mysql_select_db ("server_db");
$term = $_POST['term'];
if(isset($_POST['submit'])){
if($term == ""){
echo "Please Enter a search term";}
$sql = mysql_query("select * from new_file where name like '%$term%'");
$rows = mysql_num_rows($sql);
while ($row = mysql_fetch_array($sql)){
echo 'ID: '.$row['ID'];
echo '<br/> First Name: '.$row['first'];
echo '<br/> Last Name: '.$row['last'];
echo '<br/> Country: '.$row['country'];
echo '<br/><br/>';
}
if(!$rows)
echo "No results where found for $term";
}
?>
<form action="search.php" method="post">
Search: <input type="text" name="term" value="Search" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
Help is greatly appreciated