Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = $this->db->select('*')->from('table');
- $where = array();
- $ft_min_word_len = mysql_result(mysql_query("SHOW VARIABLES LIKE 'ft_min_word_len'"), 0, 1);
- 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 = "[[:<:]]" . mysql_real_escape_string($part) . "[[:>:]]";
- $query->where("([z.cz_nazev] %sql OR [z.cz_popis] %sql)", $regexp, $regexp);
- }
- }
- $query->fetchAll();
Advertisement
Add Comment
Please, Sign In to add comment