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,
)
This appears to be a duplicate of phpmyadmin - count(): Parameter must be an array or an object that implements 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):
Edit file '/usr/share/phpmyadmin/libraries/sql.lib.php' and replace
With:
This works because:
Consider updating phpmyadmin and fix a whole bunch of bugs. It's now on 4.8.2 https://www.phpmyadmin.net/news/
I solved the problem by validating if it really is an array using the is_array() function like this: