I have a search area on my site and when I put in a search keyword, the results.php page has every item on it. I have searched and searched and I cannot figure out why it is doing it.
Any help would be greatly appreciated.
search form
<form id="search-form123" action="results.php" method="POST">
<div class="offlajn-ajax-search-inner">
<input type="text" name="keyword" id="search-area123" value="" autocomplete="off" placeholder="Search Here...">
<input type="submit" name="Submit" value="Search" id="search-area123">
<input type="hidden" name="Submit" value="com_search">
</form>
results.php (at the top)
<?php
include_once('mysql_connect.php');
if (!isset($_POST['search']))
$keyword = $_POST['search'];
$search_sql="SELECT * FROM new_equip WHERE itemname LIKE '%" .$keyword. "%'";
$search_query=mysql_query($search_sql);
if(mysql_num_rows($search_query)!=0) {
$search_rs=mysql_fetch_assoc($search_query);
}
$eid = $row['id'];
$itemname = $row['itemname'];
$model = $row['model'];
$manufactuer = $row['manufactuer'];
$desc = $row['desc'];
$imagename = $row['image'];
?>
where results are displayed
<?php if (mysql_num_rows($search_query)!=0){ do {?>
<p><a href="new-product.php?Item=<?php echo $search_rs['id']; ?>"><?php echo $search_rs ['itemname']?></a></p>
<?php } while ($search_rs=mysql_fetch_assoc($search_query)) ;
} else { echo "No Results Found";
} ?>