I keep getting the following errors with mysql connection through XAMPP and I don\'t know what to do:
That\'s the code in the config.inc.php
This error is caused by a line of code in /usr/share/phpmyadmin/libraries/sql.lib.php.
It seems when I installed phpMyAdmin using apt, the version in the repository (phpMyAdmin v4.6.6) is not fully compatible with PHP 7.2. There is a newer version available on the official website (v4.8 as of writing), which fixes these compatibility issues with PHP 7.2.
You can download the latest version and install it manually or wait for the repositories to update with the newer version.
Alternatively, you can make a small change to sql.lib.php to fix the error.
Firstly, backup sql.lib.php before editing.
1-interminal:
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
2-Edit sql.lib.php. Using vi:
sudo vi /usr/share/phpmyadmin/libraries/sql.lib.php
OR Using nano:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
Press CTRL + W (for nano) or ? (for vi/vim) and search for (count($analyzed_sql_results['select_expr'] == 1)
Replace it with ((count($analyzed_sql_results['select_expr']) == 1)
Save file and exit. (Press CTRL + X, press Y and then press ENTER for nano users / (for vi/vim) hit ESC then type :wq and press ENTER)