connect("localhost ","root","2027205","bh38") or die("Connection failed"); $conn->execute("set names gb2312"); $conn->execute("INSERT"/> connect("localhost ","root","2027205","bh38") or die("Connection failed"); $conn->execute("set names gb2312"); $conn->execute("INSERT">
Home > Article > Backend Development > mysql query error mysql5 write and read garbled solution
The example I wrote
Copy the code The code is as follows:
require("adodb/adodb.inc.php");
$c
$conn->connect("localhost"," root","2027205","bh38") or die("Connection failed");
$conn->execute("set names gb2312");
$conn->execute("INSERT INTO `vv` (`cc`) VALUES ('I don’t know if it will work if I change the encoding');") or die("Error");
$rc=$conn->execute("select * from vv");
while (!$rc->EOF)
{
echo($rc->fields["cc"]);
$rc->movenext();
}
?>
The above introduces the solution to mysql query error when writing and reading garbled characters in mysql5, including the content of mysql query error. I hope it will be helpful to friends who are interested in PHP tutorials.