PHP录入数据库乱码
数据库编码是“utf8_bin”字段的编码也是“utf8_bin”,php向数据库录入中文时总是乱码!php文件也用文本编辑并保存为utf-8的了,问题还是没有解决。下面是代码
PHP codeWHO在说什么楼$result1 = mysql_query("SELECT * FROM discuss where id$a$content$id";
}
?>
选择你的身份ABCD
MySQL(Linux)
MySQL 9.6.0是面向Linux平台的2026年创新版本,核心架构迎来重大革新。其将外键约束与级联操作从InnoDB引擎层上移至SQL层,确保所有数据变更均被完整记录至Binlog,彻底解决了CDC(变更数据捕获)与主从复制中的数据不一致难题。此外,该版本引入container_aware启动选项以原生适配容器环境,并对审计日志进行了组件化重构,为追求极致数据一致性与云原生体验的开发者提供了全新选择。
下载
mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO discuss (a, content) VALUES (%s, %s)",
GetSQLValueString($_POST['a'], "text"),
GetSQLValueString($_POST['content'], "text"));
mysql_select_db($database_internal, $internal);
$Result1 = mysql_query($insertSQL, $internal) or die(mysql_error());
}
mysql_select_db($database_internal, $internal);
$query_Recordset1 = "SELECT * FROM discuss";
$Recordset1 = mysql_query($query_Recordset1, $internal) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
discuss 