参数必须是在phpmyadmin中实现Countable的数组或对象 [英] Parameter must be an array or an object that implements Countable in phpmyadmin

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

问题描述

当我尝试在 phpmyadmin 中查看 wp_posts 表时,我看到了此错误消息,但不知道它的含义并且以前从未见过.

When I try and view the wp_posts table in phpmyadmin, I see this error message, but have no idea what it means and have never seen it before.

有人可以帮我尝试以某种方式摆脱它吗?

Can someone help me try and get rid of this somehow?

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

Backtrace

./libraries/sql.lib.php#2128: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#2079: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'afterhours',
string 'wp_posts',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/original/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_posts`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'afterhours',
string 'wp_posts',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/original/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_posts`',
NULL,
NULL,
)

推荐答案

这似乎与 phpmyadmin - count(): 参数必须是一个数组或一个实现 Countable 的对象

根据链接帖子上的最佳答案,./libraries/sql.lib.php 中可能存在错误,导致代码尝试对数组以外的其他对象执行 count() 函数(或实现Countable"的对象).修复它(根据链接的响应):

According to the top answer on the linked post, it looks like there may be an error in the ./libraries/sql.lib.php that is causing the code to attempt a count() function on something other than an array (or an object that implements "Countable"). To fix it (according to the linked response):

编辑文件'/usr/share/phpmyadmin/libraries/sql.lib.php'并替换

Edit file '/usr/share/phpmyadmin/libraries/sql.lib.php' and replace

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

与:

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

这是有效的,因为:

  • count 不能在非数组上执行(因此你的错误,参数必须是一个数组或一个实现 Countable 的对象")
  • count() 中的== 1"是等价测试,而不是数组
  • 从 count() 中删除== 1"留下了一个有效的 count(array) 函数.

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

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