当我尝试在phpmyadmin中查看wp_posts表时,我看到了这个错误消息,但我不知道它是什么意思,而且以前从未见过它。
有没有人能帮我摆脱这个?
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,
)发布于 2018-06-30 06:16:18
这似乎是phpmyadmin - count(): Parameter must be an array or an object that implements Countable的副本
根据链接帖子的顶部答案,看起来./libraries/sql.lib.php中可能存在错误,导致代码尝试对数组(或实现“Countable”的对象)以外的其他对象执行count()函数。要修复它(根据链接的响应):
编辑文件'/usr/share/phpmyadmin/libraries/sql.lib.php‘并替换
(count($analyzed_sql_results['select_expr'] == 1) 通过以下方式:
(count($analyzed_sql_results['select_expr']) == 1这是因为:
Countable")
发布于 2019-03-04 02:07:32
我通过使用is_array()函数验证它是否真的是一个数组解决了这个问题:
if (is_array($yourArray)) {
//Your count()
}https://stackoverflow.com/questions/51109440
复制相似问题