Choose whch course you would like to see by clicking the route name.
// Run query to list applicable routes
//
$bike = ($_POST["bike"]=='y' or $_POST["bike"]=='' ) ? 'y' : 'n';
$run = ($_POST["run"]=='y' or $_POST["run"]=='') ? 'y' : 'n';
$state = ($_POST['state']=="") ? "%" : $_POST['state'];
$country = ($_POST['country']=="") ? "%" : $_POST['country'];
$max = ($_POST['max']=="") ? "100" : $_POST['max'];
$min= ($_POST['min']=="") ? "0" : $_POST['min'];
$query = "SELECT name, bike, run, length, id, town FROM routes WHERE country LIKE '$country' AND state LIKE '$state' AND length > '$min' AND length < '$max' AND (bike='$bike' OR run='$run') ORDER BY name";
//echo "Query=$query
";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
echo "There are ".mysql_num_rows($result)." routes!
";
?>
Recently entered routes:
$query = "SELECT name, town, id FROM routes ORDER BY dateadd DESC LIMIT 5";
$recent = mysql_query($query) or die('Query failed: ' . mysql_error());
while ($myrow = mysql_fetch_assoc($recent)) {
echo " --
".$myrow['name'].", ".$myrow['town']."";
}
?>