Wednesday, June 5, 2019

MySQL: 在phpmyadmin錯誤

在查找DB時一直報錯,原來是代碼問題。
打開 /usr/share/phpmyadmin/libraries/sql.lib.php 至613行
更改前︰
((empty($analyzed_sql_results['select_expr']))
 || (count($analyzed_sql_results['select_expr'] == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*')))
更改後︰
((empty($analyzed_sql_results['select_expr']))
 || (count($analyzed_sql_results['select_expr']) == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*'))

再用sudo service apache2 restart就完成修正。


Reference: https://stackoverflow.com/questions/48001569/phpmyadmin-count-parameter-must-be-an-array-or-an-object-that-implements-co

Error infomation:

Warning in ./libraries/sql.lib.php#613 count():
Parameter must be an array or an object that implements Countable
Backtrace
./libraries/sql.lib.php#2128: PMA_isRememberSortingOrder(array) ./libraries/sql.lib.php#2079: PMA_executeQueryAndGetQueryResponse( array, boolean true, string 'text', string 'courses', NULL, NULL, NULL, NULL, NULL, NULL, string '', string './themes/pmahomme/img/', NULL, NULL, NULL, string 'SELECT * FROM `courses`', NULL, NULL, ) ./sql.php#221: PMA_executeQueryAndSendQueryResponse( array, boolean true, string 'text', string 'courses', NULL, NULL, NULL, NULL, NULL, NULL, string '', string './themes/pmahomme/img/', NULL, NULL, NULL, string 'SELECT * FROM `courses`', NULL, NULL, )

No comments: