Reputation: 81
<?php
//set charset:utf-8 //for json, is it right way to do it;
header('Content-Type:application/json; charset:utf8');
$mysqli = new mysqli('localhost','root','','hospital');
$myArray = array();
if ($result = $mysqli->query("SELECT * FROM tips")) {
while($row = $result->fetch_array(MYSQL_ASSOC)) {
$myArray[] = $row;
}
echo json_encode($myArray);
}
$result->close();
$mysqli->close();
?>
Upvotes: 2
Views: 1452
Reputation: 21
You should set the field's collation to "utf8_bin" so that mysql will store the data in gujarati properly. and also you need a proper gujarati font to apply a css class font-family propery
Upvotes: 1