habib009pk Posted April 24, 2010 Share Posted April 24, 2010 My dear friends, I am facing a problem, I have a table which has approximately 5000 colors in japanese, english and russian language and each color has a reference number. Now i want to pick this reference number and color name in english and want to dump in another table. I have only color in japanese language for the comparison. Now i am using this query: SELECT color_id, name_en from tblcolors where name_jp ='$color_japan' where $color_japan having string in japanese chracters. But when i am running this query it is not comparing with the colors table. Kindly help me how can i get my desired result. Waiting for my reply Thanks and Regards Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/ Share on other sites More sharing options...
Mchl Posted April 24, 2010 Share Posted April 24, 2010 What encoding do you use for data storage and connection to database? Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1047521 Share on other sites More sharing options...
habib009pk Posted April 24, 2010 Author Share Posted April 24, 2010 Hi Thanks for replying we are using Collation binary for the table, and datatype of this feild is varbinary. Best Regards Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1047553 Share on other sites More sharing options...
Mchl Posted April 24, 2010 Share Posted April 24, 2010 And connection encoding? Should be set to be the same as your database encoding and your webpage encoding. Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1047581 Share on other sites More sharing options...
habib009pk Posted April 27, 2010 Author Share Posted April 27, 2010 Please define how I set the connection encoding, there is still problem there I have no facility for comparing japanese string from one table to other table through sql query. Kindly help me I will be very thankful to you Thanks and Regards Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1049137 Share on other sites More sharing options...
Mchl Posted April 27, 2010 Share Posted April 27, 2010 mysql_query("SET NAMES 'utf8'"); // instead of 'utf8' put your desired encoding. Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1049150 Share on other sites More sharing options...
habib009pk Posted April 27, 2010 Author Share Posted April 27, 2010 Is it correct or where i can place you given statement ------------------------------------------------------------------ mysql_select_db($database_kansai, $crawler); $query_rscolor = "SELECT color_id, name_en from tblcolors where name_jp ='$color_japan'"; mysql_query("SET NAMES 'utf8'"); $rscolor = mysql_query($query_rscolor, $crawler) or die(mysql_error()); $row_rscolor = mysql_fetch_assoc($rscolor); ------------------------------------------------------------------ Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1049171 Share on other sites More sharing options...
Mchl Posted April 27, 2010 Share Posted April 27, 2010 Preferably right after mysql_connect(), but in general before any queries you want to use this encoding. The code you posted above shoud work ASSUMING that your HTML is encoded in utf8 AND your MySQL tables use utf8 for storage. Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1049181 Share on other sites More sharing options...
habib009pk Posted April 27, 2010 Author Share Posted April 27, 2010 No luck, The query giving zero result, I concerned with my japanese language friend and he is saying that their is too much words same in both of table. But the query giving no +ve result. Thanks and Regards Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1049230 Share on other sites More sharing options...
habib009pk Posted April 27, 2010 Author Share Posted April 27, 2010 Is any other thing we will try?? Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1049299 Share on other sites More sharing options...
fenway Posted April 28, 2010 Share Posted April 28, 2010 Is any other thing we will try?? There's nothing else to "try" -- the instructions above actually work. Quote Link to comment https://forums.phpfreaks.com/topic/199569-japaneese-langauage-matching-in-sql-query/#findComment-1050138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.