I am creating searching functionality in PHP. Whenever I search using my query, it returns texts that are similar to searched keyword/text. I want to output with the text/data that are closest to searched keyword.
For Example: If I search 'omkar' keyword then query will have to return all the records of 'omkar' as well as closest text such as 'oskar','onkar','omkr' etc.
I am using next MySQL query with PHP:
$que = mysql_query("select * from table where name like '%{$name}%'"
This code works and performs similar words/texts, but I want to display the closest word too.