I have done a code in PHP to insert data into MySql in malayalam. When I insert data, It becomes English in database.. I have set charset to utf-8 in my code and in data base utf8 general_ci..please anyone give answer..thanks in advance
Asked
Active
Viewed 5,013 times
2
-
Read this: http://dev.mysql.com/doc/refman/4.1/en/internationalization-localization.html – Rahul Desai Jan 08 '14 at 05:01
-
Have u use my code & checked it... – KesaVan Jan 08 '14 at 05:33
3 Answers
1
You can give this simple code
SELECT * FROM dictionary WHERE malayalam = 'ആകാശം'
This code will work fine in phpmysql,also you can refer this link
1
1) Add the code beginning of the php page
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2) Make sure your database & tables are on Collation utf8_general_ci
3) Use the database connection code: $conn = new mysqli($server, $user, $password, $database); $conn->set_charset("utf8");
4) Then try insert query and retrieve query using $conn handler, ie: $q_newspage="SELECT * FROM news GROUP BY id DESC LIMIT 8"; $qresult_newspage=$conn->query("$q_newspage");
Thanks

Niyas
- 11
- 1
-
thanks for mentioning collation : we generally don't set this and it becomes the swedish one by default. – Nikhil VJ Aug 23 '19 at 02:21