SQL query returns [duplicate]

1

I have a table for the query to send the information there, and " " appears instead of letters with accents. In html I'm already using <meta charset="UTF-8"> missing something? This is the first time this has happened to me.

    
asked by anonymous 24.04.2016 / 17:27

1 answer

2

In your connection to the database, you need to set the charset.

$link = mysql_connect('localhost', 'user', 'password');
mysql_set_charset('utf8',$link);

And also check if your base is in utf-8

ALTER DATABASE 'sua_base' CHARSET = UTF8 COLLATE = utf8_general_ci;
    
24.04.2016 / 18:24