J
Anyway, the problem is, if someone else could use a detailed solution, it was that the data were recorded in the default code of the connection with the server, namely mysql_query. As a result, he simply exported to the local host database and created a duplicate with fully purified ( empty tables) and launched the violin. define('BD_HOST','localhost'); //хост бд
define('BD_PASS','password'); //пароль бд
define('BD_LOGIN','dante'); //Логин бд
define('BD_FROM','coa'); //исходная БД
define('BD_IN','coreprot'); //конечная БД
$tables = array ( 'bask',
'bonus',
'razdel',
'tovar'); //Массив со всеми таблицами которые надо переписать нормально
foreach ($tables as $table) {
mysql_connect(BD_HOST,BD_LOGIN,BD_PASS);
mysql_select_db(BD_FROM);
mysql_query("set names 'latin1'");//тут ставим дефолтную корявую кодировку (Это важно!!!)
$query_select_from = "SELECT * FROM $table;";
$result = mysql_query($query_select_from);
mysql_close(); //запросили все косячные данные и закрыли соединение
mysql_connect(BD_HOST,BD_LOGIN,BD_PASS);
mysql_select_db(BD_IN);
mysql_query("set names utf8"); //открыли новое соединение, но уже указав нормальную кодировку
while ($t = mysql_fetch_assoc($result)) {
$values = '';
$f = false;
foreach($t as $val) {
$p = ($f)?',':'';
$f = true;
$add = (is_int($val))?"$val":"'$val'";
$values.= "$p $add";
};
$insert_in = "INSERT $table VALUES($values)";
mysql_query($insert_in); //запись прочтенной строки, уже в нормальном соединении
};
mysql_close(); //закрываем соединение, что бы открыть его уже для другой таблицы.
?As a result, the database was rewritten in a normal code and in pma and on the site, it was fine, and it was set up at the time of the connection with the normal code:mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET SESSION collation_connection = 'utf8_general_ci'");
And all the pros, I repeat, here, I guess the original code of the compound that all was recorded in a coma.