Вопрос

The script written in UTF-8 coding. If the script stores the data into the DB and than fetch it and displays - everything is OK. But phpmyadmin will show the strings as a garbage like "Роман Матвеев".

If I would edit the string in phpmyadmin to make it appeared correctly in phpmyadmin than this data will not be displayed correctly with PHP script (it will through '????? ?????????' instead).

What should I do? Which application works in a wrong way?

Than DB dump is the following:

-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Мар 04 2014 г., 20:40
-- Версия сервера: 5.5.35
-- Версия PHP: 5.4.4-14+deb7u7

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

CREATE TABLE IF NOT EXISTS `drivers` (
  `id` varchar(12) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(100) NOT NULL,
  `phone` bigint(10) unsigned NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` varchar(10000) NOT NULL,
  `rating` decimal(1,1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `drivers` (`id`, `email`, `password`, `phone`, `name`, `description`, `rating`) VALUES
('9fd88b195c85', 'user@example.com', '12345', 1234567890, 'Роман Матвеев', '0', 0.9);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top