Search code examples
mysqlphpmyadminspecial-charactersmysqlimport

MYSQL CSV import Characters turn into '?'


I am new to MySQL and facing this trouble since many days ,please pardon my technical terminology. After researching a lot and failing I decided to post the question. I am using PHP and MYSQL to create customers web application. The data from user comes in an excel file which goes into the application.

The problem is this excel file has special characters all of them get converted to '?' when I import it into MYSQL using PHPMyAdmin GUI Import option.

What I have tried so far:

  • Converting it into csv and then uploading it via PHPMyAdmin GUI Import option , now I have read blogs and posts to upload this file in UFT-8 character set but this is not working it still gives me '?'. My database character set is also UFT-8.
  • Uploading excel directly via PHPmyAdmin GUI import option (character set UFT-8) , still not working.
  • Converting excel spreadsheet into Open spreadsheet document and uploading via PHPmyadmin GUI Import option - This worked the characters were intact., but when I use aggregate functions on database, it does not give me the desired result . (basically it increases my trouble going further)

If someone can help me to solve this problem with CSV import , I would really appreciate it because moving forward user will be uploading the CSV and I can easily import data in MYSQL with 'LOAD DATA INFILE' command via PHP.

Example of special characters : ' ² ' (square symbol).


Solution

  • I think you can try these method phpMyAdmin UTF-8, datasource , connection, database, php code