for som reason my numrows is wrong my sites code is
[php]
Xedgo - Search<form action='results.php' method='get'>
<input type='text' name='input' size='50' value='<?php echo $_GET['input']; ?>' class="sarch-field" />
<input type='submit' value='Search' class="seach-button">
</form>
</center>
<br/>
<?php
$input = $_GET['input'];//Note to self $input in the name of the search feild
$terms = explode(" ", $input);
$query = "SELECT * FROM search WHERE ";
foreach ($terms as $each){
$i++;
if ($i == 1)
$query .= "keywords LIKE '%$each%' ";
else
$query .= "OR keywords LIKE '%$each%' ";
}
// connecting to our mysql database
mysql_connect("*****", "******", "*******");
mysql_select_db("searchengiene");
$query = mysql_query($query);
$numrows = mysql_num_rows($query);
if ($numrows > 5){
while ($row = mysql_fetch_assoc($query)){
$id = $row['id'];
$title = $row['title'];
$description = $row['description'];
$keywords = $row['keywords'];
$link = $row['link'];
echo "<h2><a href='$link'>$title</a></h2>
$description<br /><br />";
}
}
else
echo "No results found for \"<b>$input</b>\"";
// disconnect
mysql_close();
?>
[/php]