Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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;
}
}
?>
Copy link to clipboard
Copied
Thank you man! that really helped!!!!
and kudos for posting yourself just to help others with the same problem