-1

While inserting data "Jack - Jill" in mysql db, it saving as "Jack †Jill“, my problem is when i tried to display the string in page its showing like "Jack �€� Jill", i am just botherd to display the string properly like "Jack - Jill", i tried have proper charactersets but not much of luck.

Naveen
  • 3
  • 1
  • 2
    *"i tried have proper charactersets"* - what exactly does that mean, what exactly have you tried? – deceze May 09 '14 at 07:48
  • Please follow this link: http://stackoverflow.com/questions/10607041/mysql-insert-to-a-table-his-name-contains-dash – Zeshan May 09 '14 at 07:49
  • @deceze: having header('Content-Type: text/html; charset=utf-8'); in php, in HTML head and executing query mysql_query(SET NAMES utf-8) – Naveen May 09 '14 at 07:52
  • Zeshan data is already inserted into db, my problem is displaying it not the insertion or table_name – Naveen May 09 '14 at 07:53

1 Answers1

0

make sure you specify the charset used by your page to the database (and all its tables), and the other way around. i.e.:

Give your page a metatag and the script witing to the database a line that either validates that the charset is UTF-8 (example charset), or that it converts the chaarset to UTF-8

and give your database the same property, that it saves and reads data as UTF-8 (i use PHPMyAdmin, if you use such GUI tools too, its just a checkbox away).

hope i pointed you into the right direction

Lighty
  • 103
  • 1
  • 9