Home  >  Q&A  >  body text

PHP inserts strange symbols instead of polish letters

When I use this code to insert data from mysql database it does not populate with polish letters but shows random weird symbols instead of polish letters Also this seems to be a problem with the database site but I am on utf8_polish_ci There it is: PHP displays symbols instead of letters

 $con=mysqli_connect("localhost","blank","blank","blank");
    if (mysqli_connect_errno())
    {
        echo "Nie Udało się połączyć z bazą danych: " . mysqli_connect_error();
    }

    $result = mysqli_query($con,"SELECT * FROM Delegacje");

    echo "<table>
<tr>
<th>Imię i Nazwisko</th>
<th>Data od</th>
<th>Data do</th>
<th>Miejsce wyjazdu</th>
<th>Miejsce przyjazdu</th>
</tr>";

    while($row = mysqli_fetch_array($result))
    {
        echo "<tr>";
        echo "<td>" . $row['Imie i Nazwisko'] . "</td>";
        echo "<td>" . $row['Data od'] . "</td>";
        echo "<td>" . $row['Data do'] . "</td>";
        echo "<td>" . $row['Miejsce wyjazdu'] . "</td>";
        echo "<td>" . $row['Miejsce przyjazdu'] . "</td>";
        echo "</tr>";
    }
    echo "</table>";

    mysqli_close($con);




P粉189606269P粉189606269235 days ago374

reply all(1)I'll reply

  • P粉441076405

    P粉4410764052024-02-27 16:02:53

    Try opening the file in regular notepad and save as and selecting UTF-8 under encoding, that will also help.

    reply
    0
  • Cancelreply