5

While saving the information to the database field the settings were as follows:

character set: latin1
collation: latin1_swedish_ci

Once the users updated the information,i noticed that many information were saved as "?????????????? ??????????????? ???? ?????" (Question marks) to the database. English(language) information were saved without questions marks. All other languages were saved with question marks.

Now i have changed the character set to utf8 and all the languages are saved properly.

The problem is that i need to recover the information which is saved as question marks. eg:"?????????????? ??????????????? ???? ?????"

XAMPP Version: 5.6.19
Navicat version 11.0.17

Database server
Server version: 10.1.10-MariaDB - mariadb.org binary distribution

Web server
Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.19 PHP version: 5.6.19

phpMyAdmin
Version information: 4.5.1

Please help me to get the original data.

samayo
  • 16,163
  • 12
  • 91
  • 106
Pragalath
  • 51
  • 2

5 Answers5

0

MySQL replaced those characters with question marks when they were inserted into the database. The original data is lost forever -- there is no way to recover it.

0

Check your php/apache/codeigniter logs for database inserts/updates - maybe you will find there the original data which was inserted.

Alexandru
  • 14
  • 2
0

This happened because of the database collation. In this particular case it is latin1_swedish_ci.

Actually, the collation is a set of characters that can be used across the fields of the tables in a database. If you try to use a character that is not in the character set of this collation, MySQL replaces it with a question mark, because it does not know what this character is.

Having said that, there is not way to retrieve your data back. The only way is to scan through some logs of the application or MySQL (if any).

thexpand
  • 641
  • 13
  • 28
0

you have to select UTF-8_general_ci Encoding in type of collation set.

not latin1_swedish_ci

Devang Hire
  • 174
  • 1
  • 5
0

i think there is a way fetch data from the database via mysqli::query and also use mysqli::set_charset before selecting (maybe you need to try many times with different charset like utf-8,....) then you can have array of original data then change your table and database collation after all save the data.