Why is the LIKE operator works differently via PHP and through phpMyAdmin?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
17 views
The query SELECT * FROM tbl1 where text like "%word%" when I run it via php does not return an entry whose text="word".
When you run the query through phpmyadmin - word comes back
The query SELECT * FROM tbl1 where text like "%ord%" works correctly?

What could it be? I suspect that something with encodings, but the query SHOW VARIABLES LIKE 'char%' in both cases returns the same values:
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/
by | 17 views

1 Answer

0 like 0 dislike
perhaps the %w is interpreted as a date.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked May 22, 2019 by Konstantin18ko
0 like 0 dislike
1 answer
asked Apr 14, 2019 by fandorin_official
110,608 questions
257,187 answers
0 comments
40,796 users