I have a table structure like this.
I want to insert values in examples
column that can be either in Hindi or English. To insert values, I have added a procedure as follows:
PROCEDURE `insertCategories`(parentCatID INT(11), categoryName VARCHAR(100), categoryType VARCHAR(100), examples VARCHAR(200))
BEGIN
DECLARE parentID INT(11) DEFAULT parentCatID;
DECLARE categoryTitle VARCHAR(100) DEFAULT categoryName;
DECLARE catType VARCHAR(100) DEFAULT categoryType;
DECLARE catExamples VARCHAR(200) DEFAULT examples;
IF categoryTitle !='' AND catType!='' THEN
INSERT INTO categories(cat_title, parent_catID, `types`, examples) VALUE(categoryTitle, parentID, catType, catExamples);
END IF;
END$$
I am trying to call this procedure using $executingProcedure = $mysqli->query("CALL insertCategories(0, 'Exporter', 'BC', 'निर्यातक')");
But it stores value like
निर्यातक
I know this is charset problem which I tried to fix with the solution given on this link, but it didn't work. I am stuck at this problem and any help would be appreciated.
EDIT
I have tried it in mysql
and it's working, but I need to do this using mysqli
.
EDIT
Seems like problem was in html part. Added the following tag and everything worked fine.
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">