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 - Everything is so random there must be a pattern.
Country of origin displayed as flags on X - a chrome plugin.
hack

Country of origin displayed as flags on X - a chrome plugin.

Over the weekend, X's head of product Nikita Bier dropped a nuclear bomb - it showed country of origin if a user looked at another users "about" section. The amount of "tradwife", pro-MAGA, pro-Euronationalism etc accounts that turned out to be from India, Saudi, Thailand or Nigeria was staggering.
Dabitch 3 min read

Dabitch.net - Everything is so random there must be a pattern.

Hi, I'm Åsk, I'm a geeky art director working in advertising and industrial design. Here I share whatever is on my mind and the occasional script.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Dabitch.net - Everything is so random there must be a pattern. .

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

Success! Your billing info has been updated.

Your billing was not updated.