I have trying to insert the double quotes other than keyboard
for ex :
statement : Ashley is studying for an exam. During her review, she notes that “semantic” denotes “meaning” and thinks about how this relates to semantic memory. A second review showed her that
It get converted to following after being inserted into mysql database:
Ashley is studying for an exam. During her review, she notes that “semantic†denotes “meaning†and thinks about how this relates to semantic memory. A
I have converted all the tables and database into utf-8 collation and also used meta tag for utf-8 but with no success. Can someone identify the issue.
I always do it like this:
$db = new mysqli('localhost','root','','db');
$cod = $db->query("SET NAMES 'utf8'"); //Set the encoding
This code was working for me (just now):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ab</title>
<script type="text/javascript">
</script>
</head>
<body>
<?
$db = new mysqli('localhost','root','','test');
$cod = $db->query("SET NAMES 'utf8'");
$result = $db->query("INSERT INTO `test`(`string`) VALUES ('".addslashes("“teststring“")."')");
$result = $db->query("SELECT `string` FROM `test` WHERE string='".addslashes("“teststring“")."'");
$result= $result->fetch_assoc();
echo $result['string'];
?>
</body>
</html>