PHP/MySQL SELECT most similar (help me)
Posted 24 July 2006 - 02:31 AM
$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.
Posted 24 July 2006 - 06:50 AM
Posted 24 July 2006 - 07:02 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users