I created the simple search page with the code:
$keywords = str_replace(' ','%',$_POST['keywords']);
$stmt = $pdo->query("SELECT `text` FROM `records` WHERE `tags` LIKE '%$keywords%'");
It works but if the DB column "tags" has for example the word "freelance" and I entered the word "free" I get result but I should not. It must search only by full words. I had tryed the full text search with MATCH(text) AGAINST but it doesn't suit me because of stopwords
EDIT: Sorry I didn't clarify: if the DB column has for example the words "freelance web development", I entered "freelance" or "web development" or "freelance development" [by using str_replace(' ','%')] I get in results what I need. But if I entered "free" (i.e. the word is no in the DB) I should get no results but I get success result again.
Besides I echo the results through foreach. If I changed my code with IN ($array) I get no result even if I entered "freelance", probably because of foreach
I'm coder of HTML/CSS only and PHP beginner (and maybe even less) so I will be thankful for any additional comments including from security-standpoint