This topic is locked
[SOLVED]

 List Page Search Panel with Wildcards

7/19/2020 9:44:51 PM
PHPRunner General questions
A
asawyer13 authorDevClub member

I might be not understanding but what I'm needing is the search panel on the List Page to allow wildcard characters that are valid for my database. I am using MySQL.
So the user could type AB_65 and see any records that contain AB(some character)65 in the field. I would also like to use % to match multiple characters.

This would be great if it would work with the autocomplete feature.
Is this something that can be done, either thru a bit of programming or having it setup in some way that I don't understand?
Thanks

Alan

Sergey Kornilov admin 7/20/2020

It can be done with the help of some custom coding. Check Search API:

https://xlinesoft.com/phprunner/docs/searchapi_about.htm

A
asawyer13 authorDevClub member 7/20/2020

I ended up doing this and it worked great. Thanks



$srchObj = SearchClause::getSearchObject("model");



$value = $srchObj->getFieldValue("ModelNo");



if( $value != null ) {

$srchObj->setSearchSQL("ModelNo", "ModelNo like '%$value%'");

}