Mysql ... versus plain type "% term%"

What happened with:

$term = $_POST['search'];

function buildQuery($exploded,$count,$query)
{
   if(count($exploded)>$count) 
   {
      $query.= ' AND column LIKE "%'. $exploded[$count] .'%"';
      return buildQuery($exploded,$count+1,$query);
   }
   return $query;
}

$exploded = explode(' ',$term);
$query = buildQuery($exploded,1,
'SELECT * FROM table WHERE column LIKE "%'. $exploded[0] .'%"');

and then query db to get the results in a specific order instead of using myIsam-only sql match ... against?

Is this really going to hurt performance?

+5
source share
2 answers

, MySQL , . . LIKE , . .

, , , - -, . , mysql_real_escape_string()

+6
+6

All Articles