Today, I had installed PHP 7.3 and phpMyAdmin on Ubuntu 18.04 LTS system. I am using MariaDB as database server running on the same instance. When I tried to access data in tables using phpMyAdmin got the following error message on screen.

Advertisement
Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”

Warning in ./libraries/sql.lib.php#613 count()

Solution:

It looks issue is due to older version of phpMyAdmin. The version of phpMyAdmin is older before the release of PHP 7.3 and it not properly compatible with that.

In order to resolve, we recommend to upgrade the phpMyAdmin version. But you can make changes in sql.lib.php to temporarily resolve this error.

  1. Make a backup of sql.lib.php
    sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak 
    
  2. Next, edit sql.lib.php in your favorite text editor:
    sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php 
    
  3. Press CTRL + W and enter string (count($analyzed_sql_results['select_expr'] == 1) to search.

    Then, replace it with ((count($analyzed_sql_results['select_expr']) == 1)

  4. Save file and exit. (Press CTRL + X, press Y and then press ENTER).

All done. The error message should disappear now.

Share.

7 Comments

  1. Thanks a lot. The error in phpmyadmin is gone. Thanks so much for giving this tutorial and the search shortcut for nano. I don’t think I knew it was possible to search inside nano like that.

Leave A Reply


Exit mobile version