Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. [SOLVED] Select with UNICODE

[SOLVED] Select with UNICODE

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
phpdatabasemysqlhelpquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CodingLover
    wrote on last edited by
    #1

    Hi all, I wonder I've done something wrong with PHP or MySql. I've a table as follows, CREATE TABLE `my_db`.`language_translations` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `SectionID` int(10) unsigned NOT NULL, `QuestionID` int(10) unsigned NOT NULL, `Text_eng` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Text_lk` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Text_ta` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 PACK_KEYS=1; And I select data with the following function, but the text displayed as ???? characters. function GetTranslationList($m_section_id, $m_question_id) { $sql = "SELECT * FROM language_translations WHERE SectionID = ".$m_section_id." AND QuestionID = ".$m_question_id; $data = CDBCon::GetInstance()->GetAll($sql); print_r($data);exit; return $data; } anyone of you have an idea what I've done wrong here? Thanks

    I appreciate your help all the time... CodingLover :)

    D 1 Reply Last reply
    0
    • C CodingLover

      Hi all, I wonder I've done something wrong with PHP or MySql. I've a table as follows, CREATE TABLE `my_db`.`language_translations` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `SectionID` int(10) unsigned NOT NULL, `QuestionID` int(10) unsigned NOT NULL, `Text_eng` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Text_lk` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Text_ta` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 PACK_KEYS=1; And I select data with the following function, but the text displayed as ???? characters. function GetTranslationList($m_section_id, $m_question_id) { $sql = "SELECT * FROM language_translations WHERE SectionID = ".$m_section_id." AND QuestionID = ".$m_question_id; $data = CDBCon::GetInstance()->GetAll($sql); print_r($data);exit; return $data; } anyone of you have an idea what I've done wrong here? Thanks

      I appreciate your help all the time... CodingLover :)

      D Offline
      D Offline
      Dimitris Vasiliadis
      wrote on last edited by
      #2

      Is your file saved as utf8 (better without bom)? Also you should add in your html

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


      ...Plug & Pray... X|

      C 1 Reply Last reply
      0
      • D Dimitris Vasiliadis

        Is your file saved as utf8 (better without bom)? Also you should add in your html

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


        ...Plug & Pray... X|

        C Offline
        C Offline
        CodingLover
        wrote on last edited by
        #3

        Yes I do. Anyway I have found the solution myself. PHP.ini configured incorrectly with multi-bite strings. Now everything working fine.

        I appreciate your help all the time... CodingLover :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups