There is a line with the text. And there is a table in the MySQL database, some words are written in this table.

I need a query that will find in this table all the words that are in the line with the text.

It turned out such a request:

$result = mysql_query("SELECT * FROM slova WHERE INSTR('" . mysql_escape_string($text_article) . "', name)"); 

But it turns out that the Word and the word are different words. It is case sensitive.

How to avoid this?

  • You can bring both arguments to the same case, And you can configure collate - vp_arth
  • By default, the register is not counted. What type of name field? Show DDL tables - Anton Shchyrov
  • @AntonShchyrov VARCHAR field type - iKey
  • MySQL supports two types of collation, cs (case sensitive) and ci (case insensitive). In general, you need to create tables with the correct collation, here the easiest way is to use the advice above with reduction to one register. - etki
  • enSO - says that by default the search is case-insensitive. And in a linked answer, the method of converting to one register is also described. - SLy_huh

0