error in phpMyAdmin DisplayResults.php#1226 error in phpMyAdmin DisplayResults.php#1226 wordpress wordpress

error in phpMyAdmin DisplayResults.php#1226


I resolved with this

In file /usr/share/phpmyadmin/libraries/DisplayResults.php, on line 1233:

list($order_link, $sorted_header_html)    = $this->_getOrderLinkAndSortedHeaderHtml(        $fields_meta[$i], $sort_expression,        $sort_expression_nodirection, $i, $unsorted_sql_query,        $session_max_rows, $comments,        $sort_direction, $col_visib,        $col_visib[$j]    );

I've inserted a new validation of "isset" like:

$check = (isset($col_visib[$j])) ? $col_visib[$j] : false;

But using in the condition..

list($order_link, $sorted_header_html)    = $this->_getOrderLinkAndSortedHeaderHtml(        $fields_meta[$i], $sort_expression,        $sort_expression_nodirection, $i, $unsorted_sql_query,        $session_max_rows, $comments,        $sort_direction, $col_visib,        isset($col_visib[$j]) ? $col_visib[$j] : false    );

@editUsing php higher than 7.2. We can change

isset($col_visib[$j]) ? $col_visib[$j] : false

for

col_visib[$j] ?? false

then..

list($order_link, $sorted_header_html)    = $this->_getOrderLinkAndSortedHeaderHtml(        $fields_meta[$i], $sort_expression,        $sort_expression_nodirection, $i, $unsorted_sql_query,        $session_max_rows, $comments,        $sort_direction, $col_visib,        $col_visib[$j] ?? false    );


I have also faced the same notice after upgrading php 7.2 to 7.4 on phpmyadmin 4.6

Below steps solved my issue.

  1. Install PPA by hiting sudo add-apt-repository ppa:phpmyadmin/ppa Check the issue here

  2. Then run sudo apt update & sudo apt upgrade

  3. Finally restart your apache sudo systemctl restart apache2

Now i am running phpmyadmin 4.9.5deb2 and notice gone


I have upgraded php 7.2 to 7.4 and the problem with phpMyAdmin still on the same error.

The best option for me was, go to a official website:

https://www.phpmyadmin.net/

Download the lastest version, so after I went to /var/www/html where my phpMyAdmin is placed and I copy from ~/Downloads my latest version unzip as bellow:

sudo cp ~/Downloads/phpMyAdmin-5.0.4-all-languages.zip .

To assure that I had the old version I changed the name of old version

sudo mv phpMyAdmin oldphpMyAdmin

So then I unzip the new version

sudo unzip phpMyAdmin-5.0.4-all-languages.zip

After Unzip I renamed to phpMyAdmin like before

mv phpMyAdmin-5.0.4-all-languages phpMyAdmin

I tested on Browser, everything works fine. After I deleted the oldversion

sudo rm -rf oldphpMyAdmin

I'm running on Ubuntu 16.04.7 LTS