ÆØÅ

hej sidder med udtrækning af database men når jeg trækker æ, ø eller å ud laver den nogle speciel symboler ved det er noget med utf-8 men hvad skal jeg skrive de forskellige steder synes jeg har prøvet det meste :S koden er både html og PHP og har ændre den varchar hvor der er æ ø å til en utf-8_bin

Hejsa
Tjek at du har gemt dit HTML/PHP dokument i UFT-8 også, og tjek også at du har defineret UTF-8 i toppen af din HTML-side som her på 5. linje:
<!doctype html>
<html lang="da">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>
Med venlige hilsner Daniel Bahl (@db)
CEO – v5.dk ApS

hej du får lige koden her:
<!doctype html>
<html lang="da">
<html>
<body>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<div class="box">
</div>
<div class="tabel">
<map name="tabel" id="tabel">
<area onMouseOver="show('plads1')" onMouseOut="hide('plads1')" shape="rect" coords="0,39,270,18"/>
<area onMouseOver="show('plads2')" onMouseOut="hide('plads2')" shape="rect" coords="0,60,270,18"/>
<area onMouseOver="show('plads3')" onMouseOut="hide('plads3')" shape="rect" coords="0,81,270,18"/>
<area onMouseOver="show('plads4')" onMouseOut="hide('plads4')" shape="rect" coords="0,102,270,18"/>
<area onMouseOver="show('plads5')" onMouseOut="hide('plads5')" shape="rect" coords="0,123,270,18"/>
<area onMouseOver="show('plads6')" onMouseOut="hide('plads6')" shape="rect" coords="0,144,270,18"/>
<area onMouseOver="show('plads7')" onMouseOut="hide('plads7')" shape="rect" coords="0,165,270,18"/>
<area onMouseOver="show('plads8')" onMouseOut="hide('plads8')" shape="rect" coords="0,186,270,18"/>
<area onMouseOver="show('plads9')" onMouseOut="hide('plads9')" shape="rect" coords="0,207,270,18"/>
<area onMouseOver="show('plads10')" onMouseOut="hide('plads10')" shape="rect" coords="0,228,270,18"/>
<area onMouseOver="show('plads11')" onMouseOut="hide('plads11')" shape="rect" coords="0,249,270,18"/>
<area onMouseOver="show('plads12')" onMouseOut="hide('plads12')" shape="rect" coords="0,270,270,18"/>
<area onMouseOver="show('plads13')" onMouseOut="hide('plads13')" shape="rect" coords="0,291,270,18"/>
<area onMouseOver="show('plads14')" onMouseOut="hide('plads14')" shape="rect" coords="0,312,270,18"/>
<area onMouseOver="show('plads15')" onMouseOut="hide('plads15')" shape="rect" coords="0,333,270,18"/>
<area onMouseOver="show('plads16')" onMouseOut="hide('plads16')" shape="rect" coords="0,354,270,18"/>
<img id="plads1" src="images/tabelbilleder/tabelliganr1.jpg" usemap="#tabel"/>
<img id="plads2" src="images/tabelbilleder/tabelliganr2.jpg" usemap="#tabel"/>
<img id="plads3" src="images/tabelbilleder/tabelliganr3.jpg" usemap="#tabel"/>
<img id="plads4" src="images/tabelbilleder/tabelliganr4.jpg" usemap="#tabel"/>
<img id="plads5" src="images/tabelbilleder/tabelliganr5.jpg" usemap="#tabel"/>
<img id="plads6" src="images/tabelbilleder/tabelliganr6.jpg" usemap="#tabel"/>
<img id="plads7" src="images/tabelbilleder/tabelliganr7.jpg" usemap="#tabel"/>
<img id="plads8" src="images/tabelbilleder/tabelliganr8.jpg" usemap="#tabel"/>
<img id="plads9" src="images/tabelbilleder/tabelliganr9.jpg" usemap="#tabel"/>
<img id="plads10" src="images/tabelbilleder/tabelliganr10.jpg" usemap="#tabel"/>
<img id="plads11" src="images/tabelbilleder/tabelliganr11.jpg" usemap="#tabel"/>
<img id="plads12" src="images/tabelbilleder/tabelliganr12.jpg" usemap="#tabel"/>
<img id="plads13" src="images/tabelbilleder/tabelliganr13.jpg" usemap="#tabel"/>
<img id="plads14" src="images/tabelbilleder/tabelliganr14.jpg" usemap="#tabel"/>
<img id="plads15" src="images/tabelbilleder/tabelliganr15.jpg" usemap="#tabel"/>
<img id="plads16" src="images/tabelbilleder/tabelliganr16.jpg" usemap="#tabel"/>
<img src="images/tabelbilleder/tabelliga.jpg";/>
</map>
<?php
$liga =($app->userData ['liga']);
if ($liga == 0)
{
$server = "xxxxx";
$username = "xxxxx";
$password = "xxxxx";
$dbname = "xxxxx";
$conn = mysqli_connect($server, $username, $password, $dbname);
$hold= '1';
$sql="SELECT COUNT (userID) AS 'player' FROM users WHERE liga = '$hold' ";
$result=mysqli_query($conn,$sql);
$values=mysqli_fetch_assoc($result);
$num_rows=$values['player'];
if ($num_rows <= '15'){
?>
<form action="tilmeldingafsuperliga.php" method="POST">
<button name="tilmeldingafsuperliga" class="submit_3">Tilmeld dig liga</button>
</form>
<?php
}
}
else {
}
?> <div class="valgafliga">
<select name="Vælgliga" onchange="location = this.value;">
<option value="vaelgliga">Vælg Liga</option>
<option value="superliga.php">Superliga</option>
<option value="1division.php">1. Division</option>
<option value="2division.php">2. Division</option>
<option value="3division.php">3. Division</option>
</div>
</select>
<div class="ligatekst">
<?php echo "Superliga" ?>
</div>
<?php
$server = "xxxxx";
$username = "xxxxx";
$password = "xxxxx";
$dbname = "xxxxx";
// Create connection
$conn = mysqli_connect($server, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = ("SELECT userName,kampeialt,vundetkampe,uafgjortekampe,tabtekampe,maalplus,maalminus,maalialt,score FROM users WHERE liga= '1'");
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row;
while($row = mysqli_fetch_assoc($result)) {
echo '<a href="hold.php?id='.$row["userName"].'">'.$row["userName"].'</a><h1 class=kampeialt>'.$row["kampeialt"].'</h1><br><h1 class=vundetkampe>'.$row["vundetkampe"].'</h1><br><h1 class=uafgjortekampe>'.$row["uafgjortekampe"].'</h1><br><h1 class=tabtekampe>'.$row["tabtekampe"].'</h1><br><h1 class=maalplus>'.$row["maalplus"].'</h1><br><h1 class=maalminus>'.$row["maalminus"].'</h1><br>';
echo '<h5 class="maalialt">'.$row["maalialt"].'</h5><br><h5 class="score">'.$row["score"].'</h5><br>';
}
}
mysqli_close($conn);
?>
den giver stadig de samme problemer med de underlige symboler er det fordi jeg skal ændre tegnsætning til noget specielt i phpmyadmin eller er det placeret forkert eller hvad gør jeg galt?
Redigeret af
@thomasnielsen
d. 24.05.2022 kl. 17:32

Hejsa
Jeg vil helt klart anbefale du bruger PDO til din database, se evt. første guide i denne serie (https://v5.dk/php-programmering/kursus-php-mysql-mariadb-databaser.html) hvor du kan downloade mine app.php fil øverst til højre.
Herefter kan du se videoen hvor jeg henter data ud fra databasen. Hvis du bruger denne moderne teknik (PDO) fremfor den gamle mysqli er jeg ret sikker på det løser alle dine problemer :)
Med venlige hilsner Daniel Bahl (@db)
CEO – v5.dk ApS