| Subject: | Hi. |
| Summary: | Package rating comment |
| Messages: | 1 |
| Author: | Alexander Farennikov |
| Date: | 2009-07-24 01:23:41 |
| |
|
|
Alexander Farennikov rated this package as follows:
| Utility: | Insufficient |
| Consistency: | Not sure |
| Documentation: | Not sure |
| Examples: | Not sure |
|
|
 Alexander Farennikov - 2009-07-24 01:23:41
Hi. Because in building search query with logic "OR" you start it with "1 OR CONCAT(...) ...", it returns ALL rows from the table. I modified your example as follows:
$arr = array();
foreach ($text as $word) $arr[] = "CONCAT($concat) LIKE '%$word%'";
$srch = implode (" {$this->logic} ", $arr);
$sql = "SELECT DISTINCT id FROM $table WHERE $srch ORDER BY id DESC";
This query returns only relevant results.
|