Count(): Parameter Must be an Array or an Object Implementing Countable
Issue:
When opening a table in phpMyAdmin, users encounter a warning: "count(): Parameter must be an array or an object that implements Countable."
Background:
The issue stems from a function in the sql.lib.php library, where the count() function is called with an incorrect parameter.
Resolution:
To resolve the issue, edit the sql.lib.php file using the command:
sudo nano 613 /usr/share/phpmyadmin/libraries/sql.lib.php
On line 613, replace the following code:
((empty($analyzed_sql_results['select_expr'])) || (count($analyzed_sql_results['select_expr'] == 1) && ($analyzed_sql_results['select_expr'][0] == '*')))
With this code:
((empty($analyzed_sql_results['select_expr'])) || (count($analyzed_sql_results['select_expr']) == 1) && ($analyzed_sql_results['select_expr'][0] == '*'))
Additionally, delete the last closing parenthesis on line 614.
Restart the web server:
sudo service apache2 restart
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3