-1

The correct string is Culto Mensal Área Vila Mariana but it appears Culto Mensal Ãrea Vila Mariana .... Gratidão = Gratidão

I have already tried with htmlspecialchars function

<?php
    include "mysqlconecta.php"; // Conecta ao banco de dados
    $result=mysql_query("select * from CDEventos");
    echo "<table width=900 border=\"2\">";
    echo "<tr>";
    echo "<td>Titulo</td>";
    echo "<td>Local</td>";
    echo "<td>Data</td>";

    while($row=mysql_fetch_array($result)){
    echo "<tr>";
    echo "<td>".$row['titulo']."</td>";
    echo "<td>".$row['local']."</td>";
    echo "<td>".$row['data']."</td>";
    echo "<td>";
    echo "<a href=\"altera.php?id=".$row['id']."\">Alterar</a>"; 
    echo  "&nbsp&nbsp";
    echo "<a href=\"deletar.php?id=".$row['id']."\">Excluir</a>";
    echo "</td>";
    echo "</tr>";
    }
    ?>
Ladessa
  • 955
  • 4
  • 22
  • 46

2 Answers2

3

You need to set the content as UTF-8.

Use either:

header('Content-Type: text/html; charset=utf-8');

in PHP or

<meta charset="UTF-8">

in html within the head tags.

Also, as a side note:

Please don't continue using mysql_* functions as they are deprecated.

Please look into PDO or mysqli_*.

Albzi
  • 15,201
  • 5
  • 43
  • 61
  • No worries, glad I could help! Please also look at Niet's answer regarding database structure and connection too, as you should always be looking into that too! @ProappAplicativos – Albzi Apr 28 '14 at 14:37
1

Your string is in UTF8, you must therefore handle it as UTF8.

You need to set UTF8 in:

  • The database structure (column collation)
  • The database connection (a lot of people forget this)
  • The page itself (charset=utf-8 as in BeatAlex's answer)

ALL THREE must be set correctly.

Niet the Dark Absol
  • 311,322
  • 76
  • 447
  • 566