Answer the question
In order to leave comments, you need to log in
Why does the LIKE operator work differently through PHP and through phpMyAdmin?
The query SELECT * FROM tbl1 where text like "%word%" when executed via php does not return a record with text="word".
When executing a query through phpmyadmin - a record with word is returned
. In this case, the query SELECT * FROM tbl1 where text like "%ord%" works correctly?
What could it be? I suspect something with encodings, but the SHOW VARIABLES LIKE 'char%' query returns the same values in both cases:
character_set_client=utf8mb4
character_set_connection=utf8mb4
character_set_database=latin1
character_set_filesystem=binary
character_set_results=utf8mb4
character_set_server=latin1
character_set_system=utf8
character_sets_dir=/usr/ share/mysql/charsets/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question