I updated the following code fixing the <TR>
<body>
<?
$catid = $_POST['category'];
$name = $_POST['name'];
?>
<table width="300" border="0" cellspacing="1" cellpadding="1">
<?
$db = mysql_connect("localhost");
mysql_select_db("computerstore",$db);
$query1 = "SELECT Name,Price,CategoryID,Quantity FROM Products
WHERE CategoryID LIKE '".$catid."' AND Name LIKE '%".$name."%'";
$query2 = "SELECT Name,Price,CategoryID,Quantity FROM Products
WHERE CategoryID = ".$catid." AND Name LIKE '%".$name."%'";
if ($catid == '%')
$results = mysql_query($query1);
else
$results = mysql_query($query2);
while ($record = mysql_fetch_assoc($results))
{
echo "<tr>";
while (list($columnName,$columnValue) = each($record))
{
echo "<td>".$columnValue."</td>";
}
echo "</tr><BR>";
}
?>
</table>
</body>
I did a 'View Source' and it looked ok. Didn't see anything out of the ordinary. This is odd. The blank space above the table, or results, appears to be the same size as my table... As table grows, so does the white space. As table shrinks (depending on search criteria), so does the white space!
Not that it should matter, here's my code from the search.php
<body>
<h2>Search Page</h2>
<FORM action="results.php" method="post">
<SELECT name="category">
<?
$db = mysql_connect("localhost");
mysql_select_db("computerstore",$db);
$query = "SELECT CategoryName,CategoryID FROM Categories ORDER By CategoryName ASC";
$results = mysql_query($query);
echo "<OPTION Value = '%'>All Categories";
while($record = mysql_fetch_assoc($results))
echo "<OPTION Value = '".$record["CategoryID"]."'>".$record["CategoryName"];
?>
</SELECT>
<BR><BR>
<input type="text" name="name">
<BR><BR>
<input type="submit" value= "search">
</FORM>
</body>