@@ 142-154 (lines=13) @@ | ||
139 | * @param int number of likes |
|
140 | * @return string |
|
141 | */ |
|
142 | public function like($field, $match, $auto, $type, $num_likes) |
|
143 | { |
|
144 | $prefix = ($num_likes == 0) ? '' : $type; |
|
145 | ||
146 | $match = $this->escape_str($match); |
|
147 | ||
148 | if ($auto === true) { |
|
149 | // Add the start and end quotes |
|
150 | $match = '%'.str_replace('%', '\\%', $match).'%'; |
|
151 | } |
|
152 | ||
153 | return $prefix.' '.$this->escape_column($field).' LIKE \''.$match . '\''; |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * Builds a NOT LIKE portion of a query. |
|
@@ 165-177 (lines=13) @@ | ||
162 | * @param int number of likes |
|
163 | * @return string |
|
164 | */ |
|
165 | public function notlike($field, $match, $auto, $type, $num_likes) |
|
166 | { |
|
167 | $prefix = ($num_likes == 0) ? '' : $type; |
|
168 | ||
169 | $match = $this->escape_str($match); |
|
170 | ||
171 | if ($auto === true) { |
|
172 | // Add the start and end quotes |
|
173 | $match = '%'.$match.'%'; |
|
174 | } |
|
175 | ||
176 | return $prefix.' '.$this->escape_column($field).' NOT LIKE \''.$match.'\''; |
|
177 | } |
|
178 | ||
179 | /** |
|
180 | * Builds a REGEX portion of a query. |