I have develop a search engine, well I adapted from an example now I can't get it to work properly can someone please look over my coding.
This is what is in the search field in my site:
<form action="results.php" method="post">
<input class="barinput" type="input" name="metode" size="16">
<input type="image" src="go.gif" alt="Go!" border="0" value="Begin Searching!!">
</form>
and this is what I have for my results page:
<?
//error message (not found message)
$XX = "<BR><BR>We are sorry but the server was unavaliable please try again later ...";
$query = mysql_query("SELECT * FROM $usertable WHERE $metode LIKE '%$search%' LIMIT 0, 30 ");
while ($row = mysql_fetch_array($result))
{
$variable1=$row["row_name1"];
$variable2=$row["row_name2"];
$variable3=$row["row_name3"];
print ("this is for $variable1, and this print the variable2 end so on...");
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>
and this is the error I get on the page:
Warning: Supplied argument is not a valid MySQL result resource in /homepages/27/d28531142/htdocs/dmedia/results.php on line 21
We are sorry but the server was unavaliable please try again later ...
Can someone help?