0

I created a PHP application using wamp server (2.5), phpmyadmin (4.1.14). I have several forms which retrieve information from html input tags. Now if the user does not "touch" the input field of an input type text, when I save the new value to the column of database, instead of adding an empty value ("") it adds the characters:  . If the field was filled by my javascript, which gets the existing value in DB, and the user again does not touch it, it becomes like this in column: existingvalue. Further on, the value in phpmyadmin becomes: (...)existingvalue.

column display on phpmyadmin

I'm not sure if this is an encoding problem, the php scripts are encoded in UTF-8, the database is utf8_general_ci, the field is varchar(20) utf8_general_ci. Funny thing is, those weird characters are never displayed on the browser, they seem to be ignored, so everything works fine on the user display. But I think that might become a problem later on maybe.

Thanks in advance for you attention, Best Regards, Bruno

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • 1
    The addition might come from a faulty initialisation of a variable or a faulty processing of its value. Try investigating what `` means. Which are its hexadecimal codes? Can you search your source code files for them? Debugging the assignments should lead you to the root of the problem. –  Feb 10 '17 at 18:44
  • Those "weird characters" are [Byte Order Marks](http://en.wikipedia.org/wiki/Byte_order_mark) and generally occur as a result of encoding UTF8 from a file that has BOM's set. [Here's an answer](http://stackoverflow.com/a/3256014/648350) that discusses their removal from files – haxxxton Feb 15 '17 at 01:57

0 Answers0