Hello, Greetings! of the day. To store accented characters in MySQL database using PHP correctly, the charset needs to be set in PHP code as follows:
1) If PHP mysql extension is used, the following code should be used after connecting to database: mysql_set_charset("utf8");.
2) If PHP mysqli extension is used, the following code should be used after connecting to database: mysqli_set_charset($conn, "utf8");, where $ conn is database connection variable.
3) If PHP MySQL PDO extension is used, the following code should be used: $pdo = new PDO("mysql:host=localhost;dbname=dbname;charset=utf8", 'my_user', 'my_pass');
On html page, where results are displayed after retrieving data from MySQL, the following code should be used: In HtML head tag, <meta http-equiv="Content-type" content="text/html;charset=utf-8" />.
Please check, if this code works at your end. I have much expetiencing in working on projects, using PHP, MySQL. Your work will be done, according to requirements.
Thanks.