2 Replies Latest reply on Aug 27, 2011 5:37 PM by LLaffer29

    Mysql table rows show as questionmarks

    Dilian_Traikov

      Hi guys,

       

      I'm trying to display the rows of my database table in a datagrid, but as their names are written in bulgarian they appear as questionmarks. Any tips on how I can fix this?

       

      Thanks in advance

        • 1. Re: Mysql table rows show as questionmarks
          Dilian_Traikov Level 1

          I figured it out myself... Just wanted to post the solution if anybody has the same

          problem. I had a php script that I used to populate a data grid. Here is the code with the line I had to add to make the table names appear normally:

           

          <?PHP

          class PlayersService {
          public function getPlayers()
          {
            $connection = mysqli_connect("host", "username", "password", "db") or die(mysqli_connect_error());
            mysqli_query($connection, "SET CHARACTER SET utf8");
            $sql = "SELECT * FROM players";
            $result = mysqli_query($connection, $sql) or die("Query failed: " . mysqli_error($connection));
            $rows = array();
            while ($row = mysqli_fetch_object($result))
            {
             $rows[] = $row ;
            }
            return $rows;
          }

          }

          ?>

          • 2. Re: Mysql table rows show as questionmarks
            LLaffer29

            Thank you man! that really helped!!!!

             

            and kudos for posting yourself just to help others with the same problem