Fixing that pesky "Parameter must be an array" error in PhPMyAdmin

I don't know who needs to hear this... Oh well, I do, because I forget things that I've done and this here blog is as good a place as any to put something that I might need to look up later.

Fixing that pesky "Parameter must be an array" error in PhPMyAdmin

I don't know who needs to hear this... Oh well, I do, because I forget things that I've done and this here blog is as good a place as any to put something that I might need to look up later.

When your PhPMyAdmin on Ubuntu Bionic Beaver (*giggle*) and PhP 7.2 keeps spitting out dumb errors on every page load, like this;

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

You need to edit the sql.lib.php file, specifically you need to edit line 613.

sudo nano +613 /wherever/phpmyadmin/libraries/sql.lib.php

See this? Second line has a missing ")" after $analyzed_sql_results['select_expr'], and it has one extra after ['select_expr'][0] == '*'))) in the row below.

So change it to this:

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

And then restart Nginx or whatever. Now you'll not have to see that error again.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Dabitch.net.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.