phpmyadmin - count(): Parameter must be an array or an object that implements Countable(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?
推荐答案
Edit file /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 函数的计算结果始终为真.进行以下替换可以解决此问题,然后您需要删除 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的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:phpmyadmin - count(): 参数必须是一个数组或者一个实现了Countable的对象
基础教程推荐
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- PHP 守护进程/worker 环境 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 使用 PDO 转义列名 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01