Basically, what I need is the inverse of this:
SELECT * FROM `table` WHERE `query` LIKE '%string%'
Something that looks like:
SELECT * FROM `table` WHERE '%string%' LIKE 'thestringmachine'
I looked up the internet an operation called CONTAINS() but it doesn’t seem to work.
Can someone help me?
Edit:
$inc = "themachinethatthinks";
$query = mysql_query("SELECT * FROM `spell` WHERE CONTAINS('$inc',`word`)");
$num = mysql_numrows($query); $i=0;
while ($i < $num) {
$val = mysql_result($query,$i,"word");
echo $val."<br>";
$i++;
}
The database contains lot of words (only).
I am not sure I understand what you need, but I try:
If you need query to be case insensitive: