after trying any hours to add fulltext indexes into my table I found that Like %searchword% works too like that. I get from a first query the array $keywordse and after that I create with $keywordsonetoeight = implode(', ', $keywordse[0]); a comma seperated list with this output: string(25) "firstword, secondword, , , , , ,". I use mysql and the table runs with MyIsam.
$keywordse looks like this:
array(1) { [0]=> array(8) { ["keyword1"]=> string(0) "" ["keyword2"]=>
string(5) "ballo" ["keyword3"]=> string(5) "ballo" ["keyword4"]=>
string(0) "" ["keyword5"]=> string(0) "" ["keyword6"]=>
string(0) "" ["keyword7"]=> string(0) "" ["keyword8"]=> string(0) "" } }
my query:
"SELECT *
FROM posts
WHERE title, text, area, contact LIKE %'$keywordsonetoeight'% AND (autorid != $userid)
ORDER BY id DESC";
The output is NULL
This works:
"SELECT *
FROM posts
WHERE title LIKE '%firstword%' AND (autorid != $userid)
ORDER BY id DESC";