I am having trouble displaying Hungarian letters that are read from a database.
Here is the output
and here is the code
<?php
mySQL_connect("localhost","[SNIPPED]","[SNIPPED]") or die (mysql_error()); // connect to mySQL
echo ("Connected to MySQL");
echo ("<hr /><br />");
mysql_select_db("otlethu1_aru") or die (mysql_error()); //connect to otlerhu1_faaru database
echo ("Connected to database");
echo ("<hr /><br />");
$sql = mysql_query ("SELECT * FROM `Fa` ORDER BY `ID` ASC") or die(mysql_error()); //select all fields from Test table
while ($row = mysql_fetch_array($sql)){
echo ($row['Product']);
echo ("<br />");
}
?>
and here is the same code with some html added
<!DOCTYPE html>
<head>
<title>Website Name</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="styles.css" media="screen" />
</head>
<body>
<div class="wrapper">
<center>
<div class="header"></div>
<div class="navbar">
<div class="button">
<a href="index.php">Főoldal</a>
</div>
<div class="button">
<a href="products.php">Termékek</a>
</div>
<div class="button">
<a href="about.php">Rólunk</a>
</div>
<div class="button">
<a href="contact.php">Elérhetőség</a>
</div>
</div>
<div class="phpbody">
<?php
mySQL_connect("localhost", "[SNIPPED]", "[SNIPPED]") or die(mysql_error());
// connect to mySQL
mysql_select_db("otlethu1_aru") or die(mysql_error());
//connect to otlerhu1_faaru database
if($_GET['page'] == "fa") {
echo("<h1>Fa</h1><hr /><br />");
$sql = mysql_query("SELECT * FROM `Fa`") or die(mysql_error());
//select all fields from Test table
while($row = mysql_fetch_array($sql)) {
echo($row['Product'] . "<br />");
}
} else if($_GET['page'] == "villany") {
echo("<h1>Villany</h1><hr /><br />");
$sql = mysql_query("SELECT * FROM `Villany`") or die(mysql_error());
//select all fields from Test table
while($row = mysql_fetch_array($sql)) {
echo($row['Product'] . "<br />");
}
}
?>
</div>
</center>
</div>
</body>
</html>
and here is the output for that
Can anyone help me fix this issue? the database has stored them correctly (I can now see the letters, while before some of them were replaced by question marks. View screenshot)
Thanks for any help.