gpt4 book ai didi

mysql - 如何修复 "The SELECT would examine more than MAX_JOIN_SIZE rows"问题?

转载 作者:行者123 更新时间:2023-11-29 15:57:41 44 4
gpt4 key购买 nike

我正在使用 MySQLi Procedural 从 MYSQL 数据库运行查询。我只看到这是如何使用 MySQLi 面向对象代码完成的

它在本地主机上完美运行,但在远程服务器上我收到一条错误消息,指出我有超过 MAX_JOIN_SIZE 行。我应该使用什么代码来修复此错误?

我已经查看了与此错误相关的所有页面,尽管我知道问题是什么,但我不知道如何修复它。我见过的所有示例都使用 MySQLi 面向对象代码。我尝试过限制(LIMIT 30)返回的记录数量,但这没有什么区别。

<?php
$con=mysqli_connect("localhost","******","******","ps10");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$query_rs4 = "SELECT * FROM student_data INNER JOIN users ON student_data.class = users.class INNER JOIN ext_writing_tbl ON student_data.id = ext_writing_tbl.id";

$rs4 = mysqli_query($con, $query_rs4)or die( mysqli_error($con) );
$row = mysqli_num_rows($rs4);
echo "There are " . $row . " students in this class";
?>

这是完整的错误消息。

The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay.

它应该输出到表格。

最佳答案

我现在确信这是在服务器上设置的并且超出了我的控制范围。那么如何编写一个不使用三个表的查询(使用 INNER JOIN 两次)?

关于mysql - 如何修复 "The SELECT would examine more than MAX_JOIN_SIZE rows"问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56360954/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com