Hello I bought this app code that uses data from sql database. There is no problem in english, but I need to use czech special signs like č,ř,š,ě,í,é.. I can alter the data using these czech signs in CMS without problem, but in sql database they are wrong (like é instead of č), when I alter the data in database its wrong in CMS (in different way č is ?) and than its of course wrong in android app also or it crashes because it does not recognize charset. I try to solve this for more than month, I have read everything here and on google, but still dont know where the problem is. I have even recreated whole database by hand and set up by hand for each table utf8, or utf8mb4. I have tried to add to function
mysql_query("SET NAMES 'utf8mb4'");
or
mysql_query("SET NAMES 'utf8'");
but it has zero effect like I did not do anything
I have of course changed all the php files to utf8 or utf8mb4, but the errors are still the same. I did the same with database.
If I run
SHOW VARIABLES LIKE '%character%'
I get these results:
character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database utf8
character_set_filesystem binary
character_set_results utf8mb4
character_set_server utf8
character_set_system utf8
character_sets_dir /usr/share/percona-server/charsets/
PHP Version 5.4.45
Thanks for any ideas or any help.
Update: SHOW CREATE TABLE returned:
category CREATE TABLE `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`institution_id` int(11) NOT NULL,
`programme_id` varchar(255) COLLATE utf8_bin NOT NULL,
`name` varchar(255) COLLATE utf8_bin NOT NULL,
`description` text COLLATE utf8_bin NOT NULL,
`question_time` varchar(255) COLLATE utf8_bin NOT NULL,
`limits` varchar(255) COLLATE utf8_bin NOT NULL,
`correct_ans_score` int(11) NOT NULL,
`wrong_ans_score` int(11) NOT NULL,
`expire_date` varchar(255) COLLATE utf8_bin NOT NULL,
`no_of_days` varchar(255) COLLATE utf8_bin NOT NULL,
`status` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_bin
category CREATE TABLE `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`institution_id` int(11) NOT NULL,
`programme_id` varchar(255) COLLATE utf8_bin NOT NULL,
`name` varchar(255) COLLATE utf8_bin NOT NULL,
`description` text COLLATE utf8_bin NOT NULL,
`question_time` varchar(255) COLLATE utf8_bin NOT NULL,
`limits` varchar(255) COLLATE utf8_bin NOT NULL,
`correct_ans_score` int(11) NOT NULL,
`wrong_ans_score` int(11) NOT NULL,
`expire_date` varchar(255) COLLATE utf8_bin NOT NULL,
`no_of_days` varchar(255) COLLATE utf8_bin NOT NULL,
`status` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_bin