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

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

javascript - Create websocket without connecting -

android - Linear layout children not scrolling -