Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search with two or more keywords return error
01-16-2012, 11:52 PM,
#1
Search with two or more keywords return error
I tried to search with two or more keywords and DMS returned few errors:
Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3 CONCAT_WS(' ', `tblFolders`.`name`, `tblFolders`.`comment`) LIKE '%december%')' at line 1
SELECT COUNT(*) AS num FROM `tblFolders` WHERE 1=1 AND (CONCAT_WS(' ', `tblFolders`.`name`, `tblFolders`.`comment`) LIKE '%faktura%' 3 CONCAT_WS(' ', `tblFolders`.`name`, `tblFolders`.`comment`) LIKE '%december%') AND `tblFolders`.`folderList` LIKE '%:1:%'

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3 CONCAT_WS(' ', `tblDocuments`.`keywords`, `tblDocuments`.`name`, `tblDocuments' at line 1
SELECT COUNT(*) AS num FROM `tblDocumentContent` LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentContent`.`document` LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusID` = `tblDocumentStatus`.`statusID` LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentStatus`.`version` AND `ttcontentid`.`document` = `tblDocumentStatus`.`documentID` LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` LEFT JOIN `tblDocumentCategory` ON `tblDocuments`.`id`=`tblDocumentCategory`.`documentID` WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` AND `ttcontentid`.`maxVersion` = `tblDocumentContent`.`version` AND (CONCAT_WS(' ', `tblDocuments`.`keywords`, `tblDocuments`.`name`, `tblDocuments`.`comment`) LIKE '%faktura%' 3 CONCAT_WS(' ', `tblDocuments`.`keywords`, `tblDocuments`.`name`, `tblDocuments`.`comment`) LIKE '%december%') AND `tblDocuments`.`folderList` LIKE '%:1:%'

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3 CONCAT_WS(' ', `tblDocuments`.`keywords`, `tblDocuments`.`name`, `tblDocuments' at line 1
SELECT `tblDocuments`.*, `tblDocumentContent`.`version`, `tblDocumentStatusLog`.`status`, `tblDocumentLocks`.`userID` as `lockUser` FROM `tblDocumentContent` LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `tblDocumentContent`.`document` LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusID` = `tblDocumentStatus`.`statusID` LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentStatus`.`version` AND `ttcontentid`.`document` = `tblDocumentStatus`.`documentID` LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` LEFT JOIN `tblDocumentCategory` ON `tblDocuments`.`id`=`tblDocumentCategory`.`documentID` WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` AND `ttcontentid`.`maxVersion` = `tblDocumentContent`.`version` AND (CONCAT_WS(' ', `tblDocuments`.`keywords`, `tblDocuments`.`name`, `tblDocuments`.`comment`) LIKE '%faktura%' 3 CONCAT_WS(' ', `tblDocuments`.`keywords`, `tblDocuments`.`name`, `tblDocuments`.`comment`) LIKE '%december%') AND `tblDocuments`.`folderList` LIKE '%:1:%' LIMIT 0,20

With one keyword searching works. I tried to investigate issue and found problem in /LetoDMS_Core/Core/inc.ClassDMS.php, function search(). In function parameters are two parameters $mode with different meaning. After renaming first $mode parameter to something else (like $logical_mode) and replacing variable on several places in function, it works.

LetoDMS version: LetoDMS, 3.3.0-pre1
PHP version: 5.2.14
Reply
01-17-2012, 02:34 PM,
#2
RE: Search with two or more keywords return error
(01-16-2012, 11:52 PM)georgius Wrote: With one keyword searching works. I tried to investigate issue and found problem in /LetoDMS_Core/Core/inc.ClassDMS.php, function search(). In function parameters are two parameters $mode with different meaning. After renaming first $mode parameter to something else (like $logical_mode) and replacing variable on several places in function, it works.

LetoDMS version: LetoDMS, 3.3.0-pre1
PHP version: 5.2.14

Thajnks for reporting this stupid error of mine. I'll fix it right now.

Uwe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)

Contact Us | LetoDMS Community Forum | Return to Top | | Lite (Archive) Mode | RSS Syndication