phpmyadmin-count():参数必须是实现Countable的数组或对象 [英] phpmyadmin - count(): Parameter must be an array or an object that implements Countable

查看:142
本文介绍了phpmyadmin-count():参数必须是实现Countable的数组或对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've uploaded the backup to a table, opening the table I see this:

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内部...

Inside phpMyAdmin...

PHP是7.2,服务器是Ubuntu 16.04,已于昨天安装.

PHP is 7.2, the server is Ubuntu 16.04, installed yesterday.

寻找我发现有些人的代码中存在此错误,但是我没有在phpMyAdmin中找到收到此错误的人...

Looking for I saw that some have this error in their code, but I did not find anyone who received it in phpMyAdmin...

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

What should I do? Is that my error? A phpmyadmin error? wait update ? I go back to PHP 7.1?

推荐答案

使用以下命令编辑文件/usr/share/phpmyadmin/libraries/sql.lib.php:

Edit file /usr/share/phpmyadmin/libraries/sql.lib.php using this command:

sudo nano +613 /usr/share/phpmyadmin/libraries/sql.lib.php

在第613行,由于$analyzed_sql_results['select_expr']之后没有右括号,因此count函数始终求值为true.进行以下替换可以解决此问题,那么您将需要删除第614行上的最后一个右括号,因为它现在是多余的括号.

On line 613 the count function always evaluates to true since there is no closing parenthesis after $analyzed_sql_results['select_expr']. Making the below replacements resolves this, then you will need to delete the last closing parenthesis on line 614, as it's now an extra parenthesis.

替换:

((empty($analyzed_sql_results['select_expr']))
    || (count($analyzed_sql_results['select_expr'] == 1)
        && ($analyzed_sql_results['select_expr'][0] == '*')))

使用:

((empty($analyzed_sql_results['select_expr']))
    || (count($analyzed_sql_results['select_expr']) == 1)
        && ($analyzed_sql_results['select_expr'][0] == '*'))

重新启动服务器apache:

Restart the server apache:

sudo service apache2 restart

这篇关于phpmyadmin-count():参数必须是实现Countable的数组或对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆