Reputation: 41
I have a form which is submitted into a mysql database. The database is set to UTF-8_GENERAL and the rows are using the same character coding as well.
But when I submit the form with a "ő" or "ű" in the text, it does not submit anything after these characters. (Example: "This is a nice ű day." It just inserts this into the db: "This is a nice")
The form validation page has the mysql_real_escape_string(); strip_tags(); before submitting to the db.
How could I solve this? Any help appreciated...
Upvotes: 3
Views: 2391
Reputation: 3615
Its good that you are using mysql_real_escape_string()!
I think the problem might be, that in some side-step form page -> header file -> core file -> mysql macro file -> inserting to DB etc.. If you are using some CMS method of course.
So basically:
mysql_query("SET NAMES utf8");
Header("Content-Type: text/html; charset=UTF-8");
If you have mastered those steps, it should be fixed. If not, then at least you have debuged out alot of possible issues :)
Upvotes: 3