I’m using this query to look for User results. The problem is that it only finds exact matches. How do I make it check for string as substring in column User?
$result2 = mysql_query("SELECT * FROM `Users` WHERE MATCH (`User`) AGAINST ('$string') LIMIT 5");
Thanks
Use the
LIKEoperator, that’s what it’s there for.Also, I hope you are escaping the
$stringvariable earlier in the code withmysql_real_escape_stringto protect against SQL Injection.