Jump to content

How to insert into mysql different language


Dathremar

Recommended Posts

Maybe the topic isn't clear enough about my problem but i didn't know how to phrase it....

 

So I will try to be as much informative as i can. The thing is that i want to insert into a languages table the id (which is a short name of the language , in my matter it is BG - Bulgarian) the name of the language (Bulgarian but with utf8 encoding which means the display of it to be on bulgarian font) ....

 

The php code that some one made before me (and works fine for ut8 - macedonian language) is:

        name = 'Ìàêåäîíñêè'; --> Here is my problem, need to write the Bulgarian word here in this kind of writing ????? so it would be inserted correctly in MySql

$name = convert_charset("$name", "windows-1251", "UTF-8"); --> this is function that calls the iconv lib function from php

 

 

$string = "UPDATE languages

  SET name = '$name'

WHERE language_id = 'MK'";

$db_chat->query($string);

 

Dunno if i am clear enough , so if you need some more info please ask. thanks in advance

Link to comment
Share on other sites

Your Charset in MySQL needs to be binary (not latin1 or whatever).

 

"Binary" is not a character set--can you clarify?

 

Ok, I checked the table settings and the Character set is ISO 8859-1 Western Europe, as far as I can see the input is made manually into the variable $name (this is a page for testing the language and inserting information about the language) and when you load the page it does the insertion.

 

So after I input here the text in the variable (dunno how to use that kind of chars) this code inserts it into the languages table.

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.