hack

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.
Dabitch 1 min read
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.

Share
Comments
More from Dabitch.net
Moving off S3 with Drupal 7
hack

Moving off S3 with Drupal 7

It seemed a great idea to use S3, but after receiving a DMCA takedown request from them regarding a film I stored there, I knew that I needed to move.
Dabitch 3 min read

Dabitch.net

Everything is so random there must be a pattern

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.