I am using a MySql database, where I store news, a small download and the note.
In the database are all the notes with their corresponding characters.
Then I pull up the titles and downloads and show them in a table that you can click to see them in full.
I did some research and put the following on each record:
<?php echo utf8_decode($row['titulo']); ?>
<?php echo utf8_decode($row['resumen']); ?>
What I get is a very disparate result. The titles there is not one that comes out with the correct characters, and the downloads some come out well and others do not.
See the images:
Could it be that the problem is that I am using netbeans?
I tried to use
<?php echo utf8_encode($row['titulo']); ?>
<?php echo utf8_encode($row['resumen']); ?>
and it works fine but I don't know if it's the best solution
From the connection you can specify the character set to use:
Just not to leave any loose ends: Check that your database and tables are encoded in utf-8 to avoid problems later.
Ok I tell you.
encode and decode are functions that need each other.
If you are going to put data in the database put encode and to translate them into human language decode
remember to look at the encoding of the database