rossman Posted May 20, 2011 Share Posted May 20, 2011 I have been struggling to figure out how to store the thai baht symbol (฿) in my mysql database. Through phpmyadmin, I try to directly insert it into a table, but I get the error: Warning: #1366 Incorrect string value: '\xE0\xB8\xBF' for column 'value' at row 1 And the input shows up as a question mark. I have tried utf8_bin, utf8_general_ci and utf8_unicode_ci collation for the table and database, but I still get the same error. If anyone out there has any insight on how I can store this symbol in my database, I would be eternally grateful Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/ Share on other sites More sharing options...
sunfighter Posted May 20, 2011 Share Posted May 20, 2011 It stores for me as ฿ and can be retrieved and echoed. Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/#findComment-1218108 Share on other sites More sharing options...
fenway Posted May 20, 2011 Share Posted May 20, 2011 That means you're not properly entering UTF-8 characters. Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/#findComment-1218157 Share on other sites More sharing options...
rossman Posted May 20, 2011 Author Share Posted May 20, 2011 that would work for me just fine sunfighter, but mine stores it as a ? How are you configured? What charset are you using? I didn't see that forum guidelines post, so here is the missing info if it helps (sorry this didn't get put in the first time) MySQL server version: 5.1.49-1ubuntu8.1 table via SHOW CREATE TABLE: CREATE TABLE `variables` ( `id` int(22) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(99) CHARACTER SET latin1 NOT NULL, `value` varchar(99) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 fenway, how do I properly enter utf8 characters? I just copy pasted the symbol into the insert field in phpmyadmin, but ultimately I want to allow users to input the symbol via php. Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/#findComment-1218202 Share on other sites More sharing options...
fenway Posted May 21, 2011 Share Posted May 21, 2011 Then something in your php script isn't set correctly. Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/#findComment-1218298 Share on other sites More sharing options...
rossman Posted May 21, 2011 Author Share Posted May 21, 2011 well, I'm using phpmyadmin to do the insert, so I'm not even using my script at this point. Other currency symbols work, like the euro. Anyway, I thought there might be an easy fix for it, but I will try another way. Thanks anyway Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/#findComment-1218315 Share on other sites More sharing options...
rossman Posted May 21, 2011 Author Share Posted May 21, 2011 I finally figured it out. there is collation for the database, the table, AND the column. I changed to utf8 for the database and table, but not the column. as soon as I did, it accepted the currency just fine !!!!!! Link to comment https://forums.phpfreaks.com/topic/236927-collation-for-thai-baht-symbol-%E0%B8%BF/#findComment-1218491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.