My database was not utf-8, how to fix the tildes, once already inserted PHP [duplicated]

2

Good morning. I have a database of 120 records, it is small, but it has an error when there are tildes, for example José a Josà ©, since it is something of practice there is no problem but if it were something bigger, it would have solution, already being inserted? BD: MYSQL Language: PHP

Here I do not want to avoid the problem of utf-8, here I want to solve the problem by not using utf-8. Solution : How to admit accents? PHP-MySQL

    
asked by Francis Yourem 25.01.2018 в 22:01
source

2 answers

2

The problem you have is character encoding , I recommend you use UTF-8 .

From MySQL side: change character encoding of your table

ALTER TABLE $table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

On the PHP side: set the UTF-8 header.

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

On the HTML side: set the goal of UTF-8.

 <meta charset="UTF-8">
    
answered by 25.01.2018 / 22:13
source
1

Try to put that goal in the index of your project so that when the browser interprets it, it shows you the accents.

<head>
    <meta charset="utf-8">

</head>
    
answered by 25.01.2018 в 22:07