Filter Phrase Query
- by alsuelo
I try to filter a phrase to make a search in my website i've this query, this code working with one word but when i type wit more than one isn't working becuase the print is without spaces.
$phrase = $this->getState($this->context.".filter_phrase");
printf("Original string: %s\n", $phrase);
if(!empty($phrase)) {
$escaped = $db->escape($phrase, true);
printf("Escaped string: %s\n", $escaped);
$quoted = $db->quote("%" . $escaped . "%" , false);
$query->where ('a.title LIKE ' .$quoted);
}
Example i type king and the output is king , when i type the king the output is theking, i want to know if exist any way to conserve the blank spaces.