Friday, 15 February 2013

database - MySQL does not identify character '?' on select -


I found the table in MySQL with the following columns:

  ID name email address borningDate  

I have a form in the HTML page that submits this data to the servlet, responsible for saving it to the database. Due to the issue of characters (already fixed), I saved a line like this, when trying to store letters with accents:

  1 9? ? ? 2015-03-01  

And now I want to delete this line.

Yes, by doing so:

  remove the table from WHERE id = 1;  

Good work is my alleged question: Why, if I try to do something like this:

from where name = '? ';

Does affect 0 rows , such as it ? Can not see as a valid character?

trying

  SELECT id, hex (name) The boring date from hex (email), hex (address), table  

will tell you what exactly is in the database, maybe this is not really ASCI question mark Question mark probably applied replacement characters When the MySQL attempts to convert the character set of the column on the character set of the connection.

To manage it more specifically, create the table table and for the character set used for the look text column it might show at the end of the table definition. It is as if DEFAULT CHARSET utf8 or something like this but it may be specified in the definition of the column.

Once you know the character set, issue SET NAMES Ksetset , for example, SET NAMES utf8 . Then release your orders again and see if you have ? Does the replacement character get better results? Obviously, it assumes that the client program you are using can handle the character set character.


No comments:

Post a Comment