12

I'm getting issue with PhpMyAdmin when exporting any database. It is coming every time.

enter image description here

Please help me if anyone has solution to resolve all these types of issues in PhpMyAdmin

Community
  • 1
  • 1
Lakhwinder Singh
  • 5,536
  • 5
  • 27
  • 52
  • 1
    Upgrade the phpmyadmin version as per this guide: https://devanswers.co/manually-upgrade-phpmyadmin/ – Mr.Web May 05 '19 at 14:59

6 Answers6

20

It seems we can't remove all the issues from PhpMyAdmin with PHP 7.2+. But we can remove this issue by change in one line in file libraries/plugin_interface.lib.php file at line no 532.

Below is the screenshot for the fix.

Before fix code looks like:-

enter image description here

After fix code looks like:-

enter image description here

Above is the only fix to solve error messages in export database screen.

Lakhwinder Singh
  • 5,536
  • 5
  • 27
  • 52
9

Yes if you're using phpMyAdmin version 4.6.6deb4, you'll get this error.

In my /usr/share/libraries/phpmyadmin/sql.lib.php file, on line 613 specifically, there seems to be an error in the if statement. Change

|| (count($analyzed_sql_results['select_expr'] == 1)

to this

|| ((count($analyzed_sql_results['select_expr']) == 1)

The first code line is attempting to count the result of a boolean expression with outputs a non-countable value ('false' or 'true').

After this change, the error went away.

Lakhwinder Singh
  • 5,536
  • 5
  • 27
  • 52
marvatron
  • 311
  • 3
  • 3
  • The file path should be `/usr/share/phpmyadmin/libraries/sql.lib.php` instead of `/usr/share/libraries/phpmyadmin/sql.lib.php` – Louis Charette Nov 17 '19 at 15:30
  • Also, this apply to a different error. The OP error involves `plugin_interface.lib.php`. This fix would be for an error in `sql.lib.php` (don't have the details) – Louis Charette Nov 17 '19 at 15:34
  • Also you have to remove one closing parenthesis at next line.. && ($analyzed_sql_results['select_expr'][0] == '*')) – Md. Mohaiminul Hasan Jul 27 '20 at 10:56
2

After testing it on PHP 7.2.10 you need to change that line like this:

if ($options != null && count(array($options)) > 0) {
Koenigsson
  • 21
  • 1
1

Ubuntu 18.04 LTS

These are the steps which worked for me. Many, many thanks to William Desportes for providing the automatic updates on their Ubuntu PPA.

Step 1 (from William Desportes post)

sudo add-apt-repository ppa:phpmyadmin/ppa

Step 2

sudo apt-get --with-new-pkgs upgrade

Step 3

sudo service mysql restart

If you have issues restarting mysql, you can also restart with the following sequence

sudo service mysql stop

sudo service mysql start

Ali Gökkaya
  • 408
  • 6
  • 20
0

Using the path /usr/share/phpmyadmin/libraries/sql.lib.php as recommended by Louis Charette in a comment on the answer by marvatron solves the problem in my case.

(Confirming and turning the comment into a proper answer.)

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
  • @LouisCharette Please note, in case you want to claim something. – Yunnosch May 02 '21 at 13:57
  • Hi user3673734. Turning a comment in to a proper answer is usually appreciated. Especially if you have reasons that the comment author won't (which I confirm after several months...). However, it would be nice to still notify the comment author. And also please be more verbose and explicit about what you are doing. This specific post risked being mistaken as a "Thanks." non-answer. Have fun. – Yunnosch May 02 '21 at 14:00
0
sudo sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php```
divine
  • 87
  • 10
  • While this code snippet may solve the problem, it doesn't explain why or how it answers the question. Please [include an explanation for your code](//meta.stackexchange.com/q/114762/269535), as that really helps to improve the quality of your post. – Luca Kiebel Feb 16 '22 at 09:36