Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


levenshtein mysql php


levenshtein mysql php  using -'php,mysql,levenshtein-distance'

$word = strtolower($_GET['term']);

$lev = 0;

$q = mysql_query("SELECT `term` FROM `words`");
while($r = mysql_fetch_assoc($q))
{
    $r['term'] = strtolower($r['term']);

    $lev = levenshtein($word, $r['term']);

    if($lev >= 0 && $lev < 5)
    {
        $word = $r['term'];
    }
}


How can I move all that into just one query? Don't want to have to query through all terms and do the filtering in PHP.
    

asked Sep 10, 2015 by ENYJay
0 votes
11 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...