Help..
Just learning php/mysql from a book and have put together a test page
as below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<label>Please enter Town:
<input type="text" name="town" /></label>
<input type="submit" value="GO" />
</form>
<p>Search Results for: <?php echo $_GET['town']; ?></p>
<?php
$connection = mysql_connect('localhost', '????????', '????????');
$db = mysql_select_db("test", $connection);
$result = @mysql_query ('SELECT name FROM site01_details WHERE town
LIKE Bury');
while ($row = mysql_fetch_array($result))
{ echo '<p>' . $row['name'] . '</p>'; }
?>
</body>
</html>
This is published at www.freeweekends.co.uk
The database has fields for name (name of a business) and town (town in
which the business is in).
I firstly wanted to create a list for the businesses in the town 'Bury'
but this fails.
Secondly I wanted to pass the town search string entered in the form to
replace 'Bury'.
Sorry but I am totally new to this and just taking my first steps, so
the fault is probably going to be an obvious one.
P.s. the search is OK if I look for all names or towns so the database
connection and naming is correct.
Many thanks
Alec