It sends to the other search page because of the action attribute in the <form> tag. If you want it to go to your new script, set the action to be that of the new script, not the old one 😉
Secondly, a SQL query should look something like:
SELECT [i]column[/i] [, [i]column[/i] [ ...]]
FROM [table [, table]
WHERE [i]condition[/i] [AND|OR [i]condition[/i] [...]]
ORDER BY [i]column[/i]
LIMIT [i]number[/i] [, [i]number[/i]]
So say I went to the search page and entered: "joe mike" I would expect the results to have one or both of those terms in there, but not necessarily in that order (i.e. "mike joe" would show up) and the could be words in between my keywords (like "mike and joe" or "joe rode his hose named 'mike'").
To do something like that, I'd take each part and break it up based on the space character, and then loop through that. Assuming that my form is using the POST method instead of the GET method, I'd have this:
<?php
$qstring = $_POST['keywords'];
$keywords = explode(' ', $qstring); // Break it up based on spaces
$query = "SELECT *
FROM `mytable`";
$where = '';
foreach($keywords as $keyword)
{
if(!empty($where))
$where .= " OR ";
else
$where = " WHERE ";
$where .= "(`column` LIKE '%{$keyword}%' OR `column2` LIKE '%{$keyword}%')";
}
$query .= $where;
$query .= "ORDER BY `column` DESC";
Of course, if that looks like greek to you, or you really don't understand, then I'd take the time to go get a book on learning SQL and read through it. Shouldn't take you longer than a couple days to get your head wrapped around SQL. It's really really simple.