I am currently working on wild card matching in URL. The argument is given by user in the URL should match with the values in database. If the argument is like PDR-*-BC,this should match all the values.
I replaced the * with % in php code.and added LIKE in SQL query as,
"Where tablename.columnname LIKE ."'mysql_real_escape_string($arg,$sql)'"" .
If the user give "PDR-NRT-BC" in URL ,the sql query with '=' or LIKE would fetch same match, but when argument has white space, LIKE wont return any value.
But for wild card match "LIKE" will help for related matches.
I have to do both conditions (single arg and wild card) in same sql query.
Is there any way to do this?