phpMyAdmin Error: "count(): Parameter Must be an Array or an Object that Implements Countable"
Have you encountered an error with phpMyAdmin stating "Warning in ./libraries/sql.lib.php#601ncount(): Parameter must be an array or an object that implements Countable"? Let's delve into the issue and provide a solution.
Cause of the Error:
The error arises from line 601 of the sql.lib.php file within the phpMyAdmin installation. This line checks if the variable $analyzed_sql_results['select_expr'] is an empty array or if it contains a single asterisk (*). However, due to a missing closing parenthesis, the count function always returns true, leading to the error.
Troubleshooting and Solution:
Edit the File:
Locate Line 613:
Make the Replacement:
Replace the following section:
((empty($analyzed_sql_results['select_expr']))
|| (count($analyzed_sql_results['select_expr'] == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*')))
With:
((empty($analyzed_sql_results['select_expr']))
|| (count($analyzed_sql_results['select_expr']) == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*'))
Remove Extra Parenthesis:
Restart Apache:
These steps should resolve the issue and eliminate the "count(): Parameter must be an array or an object that implements Countable" error within phpMyAdmin.
The above is the detailed content of How to Fix \'count(): Parameter Must be an Array or an Object that Implements Countable\' Error in phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!