Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a1420653/public_html/processform.php on line 46
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
// include MySQL-processing classes
require_once 'mysql.php';
try{
// connect to MySQL
$db=new MySQL(array
('host'=>'xxx.webhost.com','user'=>'admin','password'=>'admin',
'database'=>'search'));
$searchterm=$db->escapeString($_GET['searchterm']);
$result=$db->query("SELECT ProductList FROM
products WHERE MATCH(ProductList) AGAINST
('$searchterm')");
if(!$result->countRows()){
echo '<div class="maincontainer"><h2>No results were found. Go
back and try a new search.</h2></div>'."n";
}
else{
// display search results
echo '<div class="maincontainer"><h2>Your search criteria
returned '.$result->countRows().' results.</h2>'."n";
while($row=$result->fetchRow()){
echo '<div class="rowcontainer"><p><strong>CD Player:</strong>'.$row['cd player'].'</p>;
<p><strong>Chocolate:</strong>'.$row['chocolate'].'</p>;
<p><strong>Tea:</strong>'.$row['tea'].'</p></div>'."n";
}
{
echo '</div>';
}
}
catch(Exception $e){
echo $e->getMessage();
exit();
}
?>
</body>
</html>
I've tried to find out the problem for the past 1 hour. Can anyone find out the bug?
Thanks.