|
Posted by Alec on 09/05/05 10:02
Sorry guys but have now come a little unstuck with this after trying
some of the methods.
Its only day 6 of learning php......
So back to basics. The page below allows a user to type in a name of a
town, and search for companies from this town with certain criteria
(using two tables to cross check the town name).
What exactly do I need to split this search into groups of say 5
companies.
Sorry guys, but this is early days for me.... Thanks in advance
Alec
<title>New Page 1</title>
</head>
<body>
<?php
$connection = mysql_connect('localhost', 'uks49179', 'FWE4872xd');
$db = mysql_select_db("test", $connection);
?>
<?php $townsearch = $_GET['town']; ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<p align="center">
<input type="text" name="town" size="20" value="<?php echo
$townsearch; ?>" />
<input type="submit" value="GO" />
</form>
<?php
$result = @mysql_query ("SELECT name, townname, town, townid FROM
site01_towns, site01_details WHERE townname='$townsearch' AND
town=townid AND code='kids'");
while ($row = mysql_fetch_array($result))
{
$company = $row['name'];
echo $company;
}
?>
</body>
</html>
Navigation:
[Reply to this message]
|