I changed the charset set but does not work
CREATE TABLE `tbl_hindi` (
`data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर');
I changed the charset set but does not work
CREATE TABLE `tbl_hindi` (
`data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर');
The charset of the database needs to be
utf8_unicode_ci
.Try creating a new database, as well as a new table.
This works on my install. If it doesn't work for you, something might be wrong with your server settings.
from your phpmyadmin change collation of your table to utf16_general_ci... Note: it worked for me..
If the table has already been created and the problem is about storing (your) local language characters,
utf8_general_ci
orutf16_general_ci
would be for you: Fire following query:If this too doesn't solve your problem, try altering the database collation to
utf16_general_ci
.You do not need database change, all you need is to alter table column.
This change works fine and very feasible.
Try this:
just use N before the value like this $sql="insert into indextbl Values('Null',N'$abc')";