Hi Defender,
Thanks very much for your post. I removed the $ (sorry - i kind of knew that shouldn't be there, i was just trying things out!), but it still won't work.
Basically at the top of my index.php file I have the following.....
<?php
include ("header.php");
include ("misc.php");
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
//Select all counties from the hotel table
$query = "SELECT DISTINCT County,Town FROM hotel";
$result = mysql_query($query)
or die ("Couldn't execute query");
?>
.....then where I want my links to appear I have this.......
<tr><td><?php echo "<a href='showhotels.php?Town=Bath'>Bath Hotels</a>"; ?></td></tr>
<tr><td><?php echo "<a href='showhotels.php?Town=Birmingham'>Birmingham Hotels</a>"; ?></td></tr>
<tr><td><?php echo "<a href='showhotels.php?Town=London'>London Hotels</a>"; ?></td></tr>
etc...etc...
Then on the page where I want the hotels to be displayed I have this at the top.....
<?php
include ("header.php");
include ("misc.php");
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
//Select all hotels from the chosen area
$query = "SELECT EstablishmentName,EstablishmentType,Address1 FROM hotel WHERE County='$interest' or Town='$albert'";
$result = mysql_query($query)
or die ("Couldn't execute query");
?>
....and then this for displaying info about each hotel....
<?php
//Display results in a table
echo "<table width='561' border='0' align='center' cellpadding='0' cellspacing='0'>";
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) )
{
//Display row for each hotel
echo "<tr>\n";
echo "<td>{$row['EstablishmentName']}</td>\n";
echo "<td>{$row['EstablishmentType']}</td>\n";
echo "<td>{$row['Address1']}</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
?>
Sorry I've been so long-winded. I'd be very grateful for any guidance!!! Thanks!
LizzyD