<?php
include 'db_connect.php';
$name = $_REQUEST['sname'];
$email = $_REQUEST['email'];
$query = "SELECT * FROM info_enrol_student WHERE ES_name = '$name' AND ES_EMAIL = '$email'";
$in = mysqli_query($conn,$query) or die(mysqli_error($conn));
$count = mysqli_num_rows($in);
if (mysqli_num_rows($in) > 0)
{
header('location:index.php');
exit;
}
?>
我正在制作一个登录表单并向这个PHP代码提供数据,但是收到此错误。
非法混合排序规则(ascii_general_ci,IMPLICIT)和 (latin1_swedish_ci,COERCIBLE)用于php中的操作'='
我无法理解错误,因为之前使用相同的脚本我可以在系统中登录。
答案 0 :(得分:0)
根据您所说的错误,您需要执行以下操作: -
转到数据库表并将这两个字段collation
(ES_name
和ES_EMAIL
)更改为utf-8-bin
并更改您的查询,如下所示: -
$query = "SELECT * FROM info_enrol_student WHERE `ES_name` = $name AND `ES_EMAIL` = $email"; `