It is necessary to search the table according to the data from the post request

$query = "SELECT * FROM vhod WHERE `otdel` LIKE '%".$_POST['compare']."%' OR `number` LIKE '%".$_POST['compare']."%' OR `sname` LIKE '%".$_POST['compare']."%' OR `Time` LIKE '%".$_POST['compare']."%'"; 

When the string contains Latin characters, the query works with a bang, when I enter data in Cyrillic, the query is not executed. Checked what comes in the POST request via echo (), everything is correct there. Therefore, I assume that the matter is in the condition, but that's what ..?

  • And with the encodings everything is fine with you, the encoding of the database is set to the same when the data is received - Mike
  • And what does "request is not executed" mean? It is fulfilled, but the empty result displays? - jekaby
  • After connecting, I put the encoding UTF8. mysqli_set_charset ($ link, "utf8"); Same as in DB. - Stanislav
  • $ result = mysqli_query ($ link, $ query) or die ("Request failed"); By "the request is not executed," I meant that the message "Invalid request" appears - Stanislav
  • Moreover, if, for example, in the request to indicate that we are looking for data on only one column, then everything works, both with Cyrillic and Latin, but when I add several conditions, then such a disaster occurs. - Stanislav

0