我已经上传了备份到一个表,打开表我看到这个:

Warning in ./libraries/sql.lib.php#601
count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/sql.lib.php#2038: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#1984: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'alternativegirls',
string 'tgp_photo',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `tgp_photo`',
NULL,
NULL,
)
./sql.php#216: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'alternativegirls',
string 'tgp_photo',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `tgp_photo`',
NULL,
NULL,
)
./index.php#53: include(./sql.php)

在phpMyAdmin……

PHP是7.2,服务器是Ubuntu 16.04,昨天安装的。

我看到一些人在他们的代码中有这个错误,但我没有发现任何人在phpMyAdmin中收到它…

我该怎么办?这是我的错误吗?phpmyadmin错误?等待更新?回到PHP 7.1?


当前回答

| | ((count ($ analyzed_sql_results [' select_expr ']) = = 1

这是我在第614行更改的内容,phpmyadmin工作时没有任何错误。 需要一个(在计数之前,和一个)之前==。就是这样。

其他回答

尝试在文件中替换此函数: /usr/share/phpmyadmin/libraries/sql.lib.php

function PMA_isRememberSortingOrder($analyzed_sql_results)
{
    return $GLOBALS['cfg']['RememberSorting']
        && ! ($analyzed_sql_results['is_count']
            || $analyzed_sql_results['is_export']
            || $analyzed_sql_results['is_func']
            || $analyzed_sql_results['is_analyse'])
        && $analyzed_sql_results['select_from']
        && ((empty($analyzed_sql_results['select_expr']))
            || (count($analyzed_sql_results['select_expr']) == 1)
                && ($analyzed_sql_results['select_expr'][0] == '*'))
        && count($analyzed_sql_results['select_tables']) == 1;
}

替换功能:

function PMA_isRememberSortingOrder($analyzed_sql_results) {
return $GLOBALS['cfg']['RememberSorting']
    &&!(
        $analyzed_sql_results['is_count']
        || $analyzed_sql_results['is_export']
        || $analyzed_sql_results['is_func']
        || $analyzed_sql_results['is_analyse']
    )&&
    $analyzed_sql_results['select_from']&&
    (
        empty($analyzed_sql_results['select_expr'])||
        count($analyzed_sql_results['select_expr'])==1&&
        $analyzed_sql_results['select_expr'][0] == '*'
    )
    && count($analyzed_sql_results['select_tables']) == 1;
}

适用于UBUNTU 16.04.3 打开

usr / share /图书馆/ sql.lib.php

修改

|| (count($analyzed_sql_results['select_expr'] == 1)

To

| | ((count ($ analyzed_sql_results [' select_expr ']) = = 1)

| | ((count ($ analyzed_sql_results [' select_expr ']) = = 1

这是我在第614行更改的内容,phpmyadmin工作时没有任何错误。 需要一个(在计数之前,和一个)之前==。就是这样。

来看看:https://devanswers.co/problem-php-7-2-phpmyadmin-warning-in-librariessql-count/

首先,在编辑之前备份sql.lib.php。 在nano中编辑sql.lib.php。

$ sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php

按CTRL + W搜索(count($analyzed_sql_results['select_expr'] == 1)

将其替换为((count($analyzed_sql_results['select_expr']) == 1)

保存文件并退出。(按CTRL + X,按Y,然后按ENTER)