Generally we are doing a search operation by using like operator in sql. For example,
If user doing search text ( input string ) as "Kannan" means It's should work operation like
Select * from users where name like <cfqueryparam value="%#url.search#%" cfsqltype="cf_sql_varchar">
The above cfm query should be like ( Select * from users where name like '%Kannan%' )
One of my end user search text ( input string ) is %%% means So the query like
Select * from users where name like '%%%%%'
It's return all the records from the user table. I don't have any name contains % But the search string (%%%) return all the records.
I've directly run the select * from users where name like '%%%%%' in my sql it's also return all records from the table.
I've go through the docs they mentioned as like '%%%' (or) like '%%%%' ( or ) if the % only in between start & end % (wildcards ) symbol without any other string mean it's return all the records from the particular table.
How I can handle this problem ? If the user search %%% then should not return any records until the name column having % value
Thanks is advance !