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的对象


- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01