Hi:
I searched the forums but couldn't find what I need, so hopefully you can help me here. 🆒 🆒
My question is:
What are all steps necessary to insert unicode characters into mySQL db correctly ?
I have built a simple multi-lingual website which displays articles in 4 languages: English, French, Farsi, Kurdi.
The problems I'm having are all related to the Farsi/Kurdi parts. These languages use unicode characters, so I set my characters setting to UTF-8 in my meta tags.
Problems occur while inserting data into mySQL db.
Basically I have a form which takes the article and submits it to the db. The actual submit code works and I use addslashes() to insert the data.
My inset code look like this:
$sql=
mysql_query("INSERT INTO articles ( `article_id` , `article_title_eng` , `article_body_eng` , `article_title_far` , `article_body_far` , `article_title_krd` , `article_body_krd` , `article_title_lat` , `article_body_lat` , `article_title_fre` , `article_body_fre` , `article_date` , `article_author` , `article_publish` , `article_cat` ) VALUES ('','".addslashes($_POST['article_title_eng'])."', '".addslashes($_POST['article_body_eng'])."', '".addslashes($_POST['article_title_far'])."', '".addslashes($_POST['article_body_far'])."', '".addslashes($_POST['article_title_krd'])."', '".addslashes($_POST['article_body_krd'])."','".addslashes($_POST['article_title_lat'])."', '".addslashes($_POST['article_body_lat'])."', '".addslashes($_POST['article_title_fre'])."', '".addslashes($_POST['article_body_fre'])."', '".addslashes($_POST['article_date'])."', '".addslashes($_POST['article_author'])."', '0', '$_POST[article_cat]')");
But it seems data inserted into Farsi/Kurdi sections gets chopped somehow.
The mySQL filed for those sections is used as UTF-persian .
I can provide any info needed.
THANX
kamy