Is there an sql function to SELECT any rows in a table most similar to a field... like instead of SELECT * FROM table WHERE field LIKE '%$string%' which finds a row with keyword $string, so if $string is "hi my name is" but there isnt a row like but there is a row "hello my name is" it would pull that row because its most similar.
PHP example:
<?php
$string = trim(strip_tags(addslashes($_POST['usermsg
'])));
$sql = mysql_query("SELECT * FROM table WHERE field = '%$string%");
// This finds me a row where field "field" has the $string in it exactly somewhere
?>
How can I make it so that if it's not exact it pulls out the row with the field "field" most similar to $string?
Your great wisdom and intelligence on the matter to assist me is appreciated greatly.