IPB
Your Ad Here


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
utf problem with html form
Misha Singh
post Nov 3 2009, 10:18 PM
Post #1


Advanced Member
***

Group: Members
Posts: 7,885
Joined: 23-November 08
Member No.: 6,521



over a week i am reading articles about utf8 and how to be compatible with php and mysql, however i didn't solve my problem. :confused:

my problem is: when I send data using normal html form to mysql database, this data appear like : ???????????. wrong characters.
although my database encoding is utf-8 as its tables. and I have meta tag in the page which said that charset=utf-8 ...

may be usefull to know , i am using PDO to connect to mysql. and smarty to deal with templates.

PHP Code:





// Create a new PDO class instance

self::$_mHandler = new PDO(PDO_DSN, DB_USERNAME, DB_PASSWORD, array( PDO::ATTR_PERSISTENT => DB_PERSISTENCY));



self::$_mHandler->query('SET NAMES utf8');








Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st November 2009 - 04:11 PM
Your Ad Here