http://dev.mysql.com/doc/refman/5.0/...-matching.html
You'd have to do something severely system intensive to get it to work with ANY search pattern, but what you could do is, and it would take too long to actually write the code for this but, basically you are going to take the $find and before the query you'll take and sanitize it somewhat, you'll take all letters and make it lower case then you'll turn all hyphens and whatever else you want to allow into spaces and all repeat letters (boBBy) into a single letter (boby). So all three of your searches above would turn into "boby z". That's all the further I'm SURE of how to do, the next part I'm not, but basically in the query you're going to do something like:
PHP Code:
$result = mysql_query("SELECT * FROM mreleased WHERE name REGEXP '$regexp'") or die(mysql_error());
To get $regexp is the part I don't know fully since it'd take arrays, but you'd make an array of the characters of the new $find, "boby z" in our case. Then you'd pull a foreach() on the array making a new array $newarray[] and incrementing a number $i to indicate how many letters are in your array, each part of the new array would be "[$char|$CHAR]+" which if echoed would be [b|B]+ which should allow b, B, BB, bbbbbbb, etc but not bB nor Bbbbbbbbbb but for spaces you would just have it be [ ]+. You will then set $regexp = "^".$newarray[0].$newarray[1].$newarray[2]..."$'; so that all together $regexp would echo as, in our case ^[b|B]+[o|O]+[b|B]+[y|Y]+[ ]+[z|Z]+$ this should match what you're looking for.
__________________
PHP Code:
<?php echo "Hello World"; ?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
|