I am a php newbie and I am trying to get this form to work but I get an "error getting data" when I run my query. Any help on this would be fantastic!
Here is the html form code:
<html>
<head>
<title>Where to go play basketball?</title>
<style type="test/css">
table {
background-color: #FCF;
}
th {
width:150px;
text-align:left;
}
</style>
</head>
<body>
<h1>Venue Search</h1>
<form method="post" action="search.php">
<label> Search Criteria: <input type="text" name="term" /></label>
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
And here is search.php:
<?php
mysql_connect ("localhost", "root","*****", "baskt_venues") or die (mysql_error());
$term = $_POST['term'];
$sql = mysql_query("SELECT * FROM complete_table WHERE country LIKE $term")or die('error getting data');
while ($row = mysql_fetch_array($sql, MYSQLI_ASSOC)){
echo '<br/> Country: '.$row['country'];
echo '<br/> Date: '.$row['date'];
echo '<br/> Time: '.$row['time'];
echo '<br/><br/>';
}
?>
Thanks to everyone take the time to look at this.