Below is the current, edited script. Unfortunately, nothing comes up... Not even the "Book-o-Rama Search Results" heading within the <h1> </h1> tags. What's going on?? I can't find the error
<html>
<head>
<title>Search Results</title>
</head>
<body>
<h1>Book-0-Rama Search Results</h1>
<?php
//create short variable names
$searchType=$_POST['searchType'];
$searchTerm=trim($_POST['searchTerm']);
if(!$searchType || !$searchTerm){
echo 'You have not entered enough information to process the search';
exit;
}
if(!get_magic_quotes_gpc()){
$searchType = addslashes($searchType);
$searchTerm = addslashes($searchTerm);
}
echo $searchType;
echo $searchTerm;
$db='books';
$host='localhost';
$username='root';
$password='root';
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
if($mysql=mysql_connect($host,$username,$password)){
echo 'success connecting to mysql';
}else{
echo 'couldn\'t connect to mysql';
}
if(mysql_select_db($db,$mysql)){
echo 'success choosing database.';
}else{
echo 'couldn\'t choose db';
}
$query='SELECT * FROM TABLE WHERE '.$searchType.' like \''.$searchTerm'\'';
echo $query;
$result=mysql_query($query) or die(mysql_error());
mysql_close();
$array=array();
while($row=mysql_fetch_array($result)){
$array[]=$row;
}
print_r($array);
foreach($array AS $rowarray){
for($i=0;$i<count($rowarray);$i++){
echo $rowarray[$i];
}
}
?>
</body>
</html>