Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = $this->db->select('*')->from('table');
- $ft_min_word_len = $this->db->fetchSingle("SHOW VARIABLES LIKE 'ft_min_word_len'");
- preg_match_all("~[\\pL\\pN_]+('[\\pL\\pN_]+)*~u", stripslashes($_GET["search"]), $matches);
- foreach ($matches[0] as $part) {
- if (iconv_strlen($part, "utf-8") < $ft_min_word_len) {
- $regexp = "[[:<:]]" . $this->db->driver->escape($part, 's') . "[[:>:]]";
- $query->where("([z.cz_nazev] %sql OR [z.cz_popis] %sql)", $regexp, $regexp);
- }
- }
- $query->fetchAll();
Advertisement
Add Comment
Please, Sign In to add comment