-2

I store info into a MySQL Database via a PHP Form, the problem is that is a person inputs into the name field José Molína in the database it saves JOSé MOLíNA so it convert the accent mark into a non legible name and when I displys the info of the database in a form it shows Jos Molna (doesn´t show the letters with the accent marks).

the info of my table is ENGINE=MyISAM DEFAULT CHARSET=latin1 and the forms captures the info from a Wordpress site, could you please tell me what is the problem?

this is the way I sent the info to the database

$strNombres = htmlspecialchars(rtrim($_POST['nNombres']));
     $Nombres= filter_var($strNombres, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);

the I tried with this one but no solution

$strNombres = strtoupper((rtrim($_POST['nNombres'])));
     $Nombres = htmlentities($strNombres, ENT_QUOTES,'UTF-8');

to the manager: since you closed this question, can you tell me where is the duplicate sign where the question was edited? besides of that I would like to close my account, how come you close a question?

I just send a message via twitter for this.

enter image description here

Pablo Tobar
  • 614
  • 2
  • 13
  • 37
  • 2
    make everything UTF-8 https://stackoverflow.com/questions/279170/utf-8-all-the-way-through – Funk Forty Niner Aug 18 '17 at 15:20
  • Your database is in the wrong encoding! UTF-8 all the things! You'll need to use one of the character encoding converter functions such as http://php.net/manual/en/function.mb-convert-encoding.php if you don't – delboy1978uk Aug 18 '17 at 15:21
  • [Handling Unicode Front To Back In A Web App](http://kunststube.net/frontback/) – deceze Aug 18 '17 at 15:30
  • Thanks everyone, another quickly question, how can I report an administrator, there are some that simply close the question in this case deceze – Pablo Tobar Aug 18 '17 at 15:57

1 Answers1

-1

You need to change the charset of your table

ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;

In your case you should replace tbl_name with your table name

ALTER TABLE tbl_name CONVERT TO CHARACTER SET 'UTF-8';
Phoenix404
  • 898
  • 1
  • 14
  • 29