New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
count(): Parameter must be an array or an object that implements Countable #14332
Comments
Same issue with @alimp5 Can you try with version Actual filephpmyadmin/libraries/classes/Sql.php Lines 661 to 675 in 2f99429
|
Use and check below one (edited and fixed):
|
@alimp5 I do not understand what is the issue with this code sample. use Can you edit the unit test to add what you think is the issue ? phpmyadmin/test/classes/SqlTest.php Lines 95 to 129 in 2f99429
private function isRememberSortingOrder(array $analyzed_sql_results)
{
return $GLOBALS['cfg']['RememberSorting']
&& ! ($analyzed_sql_results['is_count']
|| $analyzed_sql_results['is_export']
|| $analyzed_sql_results['is_func']
|| $analyzed_sql_results['is_analyse'])
&& $analyzed_sql_results['select_from']
&& isset($analyzed_sql_results['select_expr'])
&& isset($analyzed_sql_results['select_tables'])
&& ((empty($analyzed_sql_results['select_expr']))
|| (count($analyzed_sql_results['select_expr']) == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*'))
&& count($analyzed_sql_results['select_tables']) == 1;
} |
I was having the same issue on ubuntu 18.04 with php 7.2 and maria db 10.1 however based on this stack exchange thread all that needed to be changed the code listed below sql.lib.php file // original
(count($analyzed_sql_results['select_expr'] == 1)
//new
(count($analyzed_sql_results['select_expr']) == 1 |
I think this is a duplicate of #13938, which relates to using an older phpMyAdmin version with PHP 7.2. The problem was fixed with version 4.7.8; I recommend though that you upgrade to the newest phpMyAdmin which is currently version 4.8.2. |
I solved the issu! thanks so much! |
Thank You! |
Edit: Sorry. I see why this was closed now. We should be pestering someone else about Apt installing older versions of PhpMyAdmin as it seems we are out of date @GrigoriyMo - but in case it helps anyone I'll leave this comment. I also had the issue mentioned above, but had to make a different edit. For me, line 613 should read: It looks like there have been some new lines added to this function since the StackExchange question was first answered, so this "patch" has been updated. Berd Schumacher was also helpful in showing how to fix Export functions, also broken: |
Expected behaviour
as default, phpmyadmin tries to load COUNT SQL function for counting the number of stored records in DB and then fetch to show them on browser.
Apache Log
cat
sql.lib.php
(as default):Solution
cat
sql.lib.php
(edited):Actual behaviour
I saw below error:
Server configuration
Operating system:
Kali Linux _ 2018.3 _ RasberryPi Zero
Web server:
Apache2 _ 2.4.29-2
Database:
MariaDB 1.10-29
PHP version:
PHP 7.2.4-1 (cli) (built: Apr 5 2018 08:50:27) ( NTS )
phpMyAdmin version:
4.6.6deb5
Client configuration
Browser:
Firefox _ Latest version
The text was updated successfully, but these errors were encountered: