Cannot I store varchar data in a mysql data table in Chinese? INSERTINTO 'phptest '. 'usermanage' ('id', 'username', 'password', 'Email ', 'Image', 'Question', varchar (255) 'anser ', 'Sex', 'brithday', 'fromwh mysql data table varchar data cannot store Chinese characters?
Insert into 'phptest'. 'usermanage '(
'Id ',
'Username ',
'Password ',
'Email ',
'Image ',
'Question ', // varchar (255)
'Anser ',
'Sex ',
'Brithday ',
'Fromwhere ', // varchar (255)
'Web ',
'QQ ',
'MSN ',
'Icq ',
'Yahoo ',
'Wangwang', // varchar (255)
'Pay ',
'Info', // varchar (255)
'Lock'
)
VALUES (
'2', 'waterboy ', '000000', [email protected]', 'http: // www.sowa.cn/face/01.gif ', 'Who is your lover', 'Don't tell you ', '1', '2017-03-01 ', 'Guangzhou', 'http: // www.waterboy.51.cn ', '0', [email protected]', '123 ', [email protected] ', 'Dark Justice', [email protected] ', 'ordinary person', '0'
)
MySQL returns:
#1366-Incorrect string value: '\ xE4 \ xBD \ xA0 \ xE7 \ x9A \ x84...' for column 'question 'at row 1
For varchar data items, an error is returned when saving them in Chinese!
------ Solution --------------------
Set the encoding of the mysql database to UTF-8.