Allow searching for arbitrary tags on documents (not just either one or all tags)

This commit is contained in:
Tobias Langhoff committed 2014-03-13 17:50:21 +01:00
1 parent b4f02e390b
commit 351a404067
1 file changed
+2 -1
+2 -1
View File
@@ -90,10 +90,11 @@ class Documents {
if ($tag == NULL){
return false;
}
$tags = implode("%' AND tags LIKE '%", explode(" ", $tag));
$sql = "SELECT d.*, dc.title AS category
FROM din_document d, din_documentcategory dc
WHERE d.documentcategory_id = dc.id " .
"AND tags LIKE '%$tag%' " .
"AND tags LIKE '%$tags%' " .
"ORDER BY name ASC";
$result =& $this->conn->query($sql);