phpMyAdmin 表搜索返回空结果,但 SQL 选择适用于特定表

问题描述 投票:0回答:4

发生的事情很奇怪,我以前从未见过这种情况,而且我对 mysql 非常熟悉。

使用 phpMyAdmin 表搜索功能搜索表时,无论我输入什么,结果都是空的。例如,在 ID 列中搜索 77 将返回空结果。但是,如果我也在 phpMyAdmin 中运行 SQL 查询,就会得到结果。例如,select * from table1 where id = ‘77’;

更奇怪的是,这只发生在一张表上,所有其他表的搜索功能都工作正常。

我尝试修复表格,但仍然出现空结果。

我在网上找不到任何人发生这种情况……

还重新启动了sql server。

mysql phpmyadmin
4个回答
0
投票

您是否使用 cPanel - 如果是,我刚刚在 cPanel 论坛上描述了如何解决该问题:

http://forums.cpanel.net/f5/unable-use-phpmyadmin-search-users-table-313381.html


0
投票

如果您的表有大量字段,通过 phpMyAdmin 界面进行的更新可能会超过 PHP 设置“max_input_vars”的值。当发生这种情况时,phpMyAdmin 期望在您的更新发布到的页面上接收的一些内部表单字段被截断,这会导致 phpMyAdmin 失败,不幸的是默默地失败,并且页面在没有警告的情况下重定向回空白搜索表单。 “max_input_vars”的默认值是 1000。我将 php.ini 文件中的值提高到 5000,没有负面影响,它为我解决了这个问题。

设置“max_input_vars”的模式为 PHP_INI_PERDIR,因此如果您无权访问 php.ini 文件,那么您可以在 .htaccess 文件、httpd.conf 文件或 .user.ini 中设置它(自 PHP 5.3 起)文件(如果您有的话)。我不确定 htaccess 文件到底需要什么代码,但执行此操作的 PHP 代码如下。

ini_set('max_input_vars', '5000');

希望这能让您朝着正确的方向开始。


0
投票

非常简单。转到表并公开下拉列表中显示的最大行数。然后您就可以按大页面进行搜索。它不会通过所有表格获取文本。它只播放表格的一页。


0
投票

我使用了以下方法,它解决了我的问题

<?php
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $namespace = $_POST["namespace"];

    if (isset($_POST['generatepod-graph'])) {
        if (!empty($namespace)) {
            $command = "/scripts/telemetry/resource/namespace-pod-cpu-usage.sh " . escapeshellcmd($namespace);
            $output = shell_exec($command);
            $plotlypodHtml = file_get_contents('/var/www/html/Telemetry/pod-resource/cpu_usage_chart.html');

            if ($plotlypodHtml !== false) {
                session_start();
                $_SESSION['plotlypodHtml'] = $plotlypodHtml;
                header("Location: /Telemetry/pod-resource/display_poresourcegraph.php");
                exit();
            } else {
                echo "Failed to load graph data.";
            }
        }
    }

    if (isset($_POST['generatemem-graph'])) {
        if (!empty($namespace)) {
            $command = "/scripts/telemetry/resource/namespace-pod-memory-usage.sh " . escapeshellcmd($namespace);
            $output = shell_exec($command);
            $plotlypodHtml = file_get_contents('/var/www/html/Telemetry/pod-resource/memory_usage_chart.html');

            if ($plotlypodHtml !== false) {
                session_start();
                $_SESSION['plotlypodHtml'] = $plotlypodHtml;
                header("Location: /Telemetry/pod-resource/display_memresourcegraph.php");
                exit();
            } else {
                echo "Failed to load graph data.";
            }
        }
    }
    
}

include 'pod-resource.html';
?>

© www.soinside.com 2019 - 2024. All rights reserved.