php - What's the best way to include wildcards into your Laravel / LAMP application search function? -


our laravel web app runs several reports users results returned , displayed in datatables.

currently, each report has single parameter , can take 1 value.

so have report called "users token" , have enter token name users have token assigned. query like:

select user usertoken token = '<parameter>' 

that's great , good, users asking 2 separate requirements.

first, have ability provide several values token like:

select user usertoken token='ac10.1' or token = 'pr10.1' or token='hr11.1'   

second want ability have wildcards like"

select user usertoken token 'ac10.%' 

to combine these 2 things have like:

select user usertoken token 'ac10.%' or token 'pr10.1' or token 'hr11.1' 

so when users enter "*" in query, we'll replace '%' in query , on. directive should work exact matches think if don't have '%' in query, right?

i can't think there's better way this. how larger applications handle problem? (i realize dangers of using wildcards when comes rows returned).


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -