i keep getting this error message when i try to search on my site i dont know where its going wrong. cheers in advance
<?php
$button = $_GET ['submit'];
$search = $_GET ['search'];
if(!$button)
echo "you didn't submit a keyword";
else
{
if(strlen($search)<=1)
echo "Search term too short";
else{
echo "You searched for \"<strong>$search</strong>\" <hr />";
mysql_connect("localhost","wd","wd");
mysql_select_db("leedsattractions");
$search_exploded = explode (" ", $search);
foreach($search_exploded as $search_each)
{
$x++;
if($x==1)
$construct .="name LIKE '%$search_each%'";
else
$construct .="AND name LIKE '%$search_each%'";
}
$construct = "SELECT * FROM Attraction WHERE $construct" ;
$run = mysql_query($construct);
$foundnum = mysql_num_rows($run);
if ($foundnum==0)
echo "No results found for \"<strong>$keywords</strong>\" <hr />";
else
{
echo "\"<strong>$foundnum</strong>\" results found !";
while($row = mysql_fetch_assoc($run))
{
echo ' <a href="details.php?ID=' . $row['AttractionID'] . '"><img src="'. $row['ImageUrl'] . '" id="img_rest" /></a>'; * *
echo ' <div class="img_rst">';
* echo ' <h2><a href="details.php?ID=' . $row['AttractionID'] . '">' . $row['Name'] . '</a></h2>';
* echo ' <p>' . $row['TypeName'] . '</p>';
echo ' <p>' . $row['Summary'] . '</p>';
echo ' <h2>' . $row['Postcode'] . '</h2>';
* echo ' </div>'; * *
* echo ' <hr />';
* * * *
}
}
}
}
?>