Jump to content

Japaneese Langauage matching in sql query


habib009pk

Recommended Posts

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

Link to comment
Share on other sites

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);

------------------------------------------------------------------

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.