How to Fix \'count(): Parameter Must be an Array or an Object Implementing Countable\' Error in phpMyAdmin?

DDD
Release: 2024-10-20 12:57:30
Original
694 people have browsed it

How to Fix

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
Copy after login

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] == '*')))
Copy after login

With this code:

((empty($analyzed_sql_results['select_expr']))
    || (count($analyzed_sql_results['select_expr']) == 1)
        && ($analyzed_sql_results['select_expr'][0] == '*'))
Copy after login

Additionally, delete the last closing parenthesis on line 614.

Restart the web server:

sudo service apache2 restart
Copy after login

The above is the detailed content of How to Fix \'count(): Parameter Must be an Array or an Object Implementing Countable\' Error in phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

source:php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!