Here is the source code. You seem to understand my exact problem however, I am already using the method you are sugesting
<?php
require "./config.inc.php";
?>
<head>
<title>RPA - Test stockist list</title>
<link href="stockist.css" rel="stylesheet" type="text/css">
</head><body>
<font color="#000099" face="verdana" size="2"><b>Stockist Search</b></font>
<form method="post" action=" <?php echo $PHP_SELF; ?>">
<br>
<p>Please enter a county to search: <input type="text" name="search" <?php echo "value='$search'"?>>
<input type="submit" name="Search" value="Find"></p>
<p>
<?php
$db = mysql_connect($host, $user, $pass);
mysql_select_db($database) or die(mysql_error());
$error = "<p>Sorry there is no match for this county</p>";
// echo"search=". $search; // debug!
if (isset($search))
{
$result = mysql_query( "SELECT * FROM stockist WHERE county like '%$search%'",$db) or die(mysql_error());
echo "<table border='0' cellpadding='3' width='500'>";
if ($myrow = mysql_fetch_row($result)) {
while ($myrow = mysql_fetch_row($result)) {
printf( "<tr>
<td><b>%s</b><br>%s<br>%s, %s<br>%s<p> </p></td>
<td valign='top' align='right'><b>Telephone:<br>
Email:<br>
Website:</td>
<td valign='top'>
<font color='#00009'> %s</font><br>
<font color='#000099'><a href='mailto:%s'>%s</a></font><br>
<font color='#000099'><a href='%s'>%s</a></font></td>
</tr>",
$myrow[1],
$myrow[2],
$myrow[3],
$myrow[4],
$myrow[5],
$myrow[6],
$myrow[7],
$myrow[7],
$myrow[8],
$myrow[8]);
}echo "</table>";
} else {
echo $error;
}
}
?>
<p> </p>
</form>
</body>