I am using MYSql. I want to use amharic language in my database. but the database is putting all the characters just like this (አማረኛ ሙከáˆ) which is supposed to be like this (አማረኛ ሙከራ) so please help me
Asked
Active
Viewed 484 times
0
-
Please share more details. Are these characters part of UTF8 or UTF16? If yes, share a sample table structure and a sample query to trigger that problem – Nico Haase Mar 20 '20 at 14:04
-
i do not know what part are they but the sample code is CREATE TABLE `news` ( `newsid` int(10) NOT NULL, `News` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, `newsimage` blob NOT NULL ) – paul kassa Mar 20 '20 at 14:16
-
Well, `latin1` does probably not contain any characters which are not common in latin alphabets. I'm not sure where amharic is spoken, but the characters you've posted look pretty different to the ones we use in Germany. Please try to switch to UTF8 instead – Nico Haase Mar 20 '20 at 15:10
-
thanks for your comment my friend Nico Amharic is spoken in Ethiopia and i tried making it UTF8 but didn't work – paul kassa Mar 21 '20 at 12:16
-
Please add all attempts to the question by editing it - also, show that your whole application is UTF8 ready, including the connection to the database itself – Nico Haase Mar 21 '20 at 12:20
-
Does this answer your question? [UTF-8 all the way through](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – gre_gor Jul 26 '22 at 08:33
1 Answers
0
In order to allow any language to work on mysql change the collation of the database to utf8_general_ci
ALTER DATABASE <dbname> CHARACTER SET utf8 COLLATE utf8_general_ci
and in order to view your data with any language from mysql database use the following code on your connection string
<?php
$link=mysqli_connect("localhost","root","","dbname");
mysqli_set_charset($link , 'utf8');
?>

Code Dreamers
- 55
- 6