Hi Abu,
Is it possible to search on more than 1 field with autocomplete ?
In my DB, firstname and lastname are in two columns. It's easier to search person with the fullname.
Thanks for your help.
Quickest solution would be to concat(firstname, ' ', lastname) as name in your select sql, then use it in autocomplete.
For now it works on one field.
Hi Abu,
I've already test the concatenation before to post my question. It's doesn't work with alias. It works without alias, but with "LIKE" comparator only.
Cannot work :
SELECT * FROM participant WHERE Concat(firstname, ' ',lastname) = '%anne%'
Can work :
SELECT * FROM participant WHERE Concat(firstname, ' ',lastname) LIKE '%anne%'
MMM… I see.
It's works, but the condition is 'anne%' and not '%anne%'. So, the query cannot select in the lastname.
You can try begins with operator by setting search options. It will then use LIKE with 'anne%'
// optionally set limited search operators (e.g. bw = begins with, 'eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc')
$col["searchoptions"]["sopt"] = array("bw");
"searchoptions" is the column filter right ?
But my question is the filter on the autocomplete, when you type in the text field of the record, not in the filter under the header. The "bc" operator is default in autocomplete filter, I wish to have "contain". So, it's possible.
Thanks for your help.