Sorry, this is my reply FIXED :o)
// $txtKeys was submited via form.
$tmpKeyword = trim(strip_tags($txtKeys));
if (strlen($tmpKeyword) < 2)
{
print "insuficient parameters";
exit();
}
$tmpKeyword = explode (" ",$tmpKeyword);
$strKeyword = "(";
for ($i=0;$i < sizeof($tmpKeyword); $i++)
{
if (strlen($tmpKeyword[$i]) >= 2)
$strKeyword .= "field LIKE '%$tmpKeyword[$i]%' OR ";
}
if (substr($strKeyword,-3) == "OR ")
$strKeyword = substr($strKeyword,0,-3);
$strKeyword .= ")";
if ($strKeyword == "()")
{
print "the keywords need be >= 2 characters";
exit();
}
$strQuery = "SELECT * FROM table WHERE $strKeyword";
// This is functionaly? Send-me comments
Fernando Figueiredo Torres
Belo Horizonte, MG, Brazil