I have installed this Levenshtein function in MYSQL. The maker advises to use this:
select levenshtein('butt', 'but') from test;
select levenshtein_ratio('butt', 'but') from test;
I want to calculate the Levenshtein Ratio between $search and each "name" entry in the DB and then echo it in PHP.
How can I accomplish that? Thanks in advance
$search = "Paul"; // The string I want compared to each DB entry
$query = "SELECT name, ??? FROM names"; // What's the MYSQL I need to use?
$response = @mysqli_query($dbc, $query);
while($row = mysqli_fetch_array($response)){
echo "Levenshtein Ratio: ".$row['???'];
echo "<br>";
}