Iam trying to show all records in phpmyadmin, phpmyadmin givin warning When I try to access on the of the tables in my database on PHPMyAdmin, it seems to crash PHPMyAdmin alltogether.
I can’t find solutions online and I ask for your help
I have a problem that I can’t solve, error Notice in ./libraries/DisplayResults.php#1226
Notice in ./libraries/DisplayResults.php#1226
Trying to access array offset on value of type bool
Backtrace
./libraries/DisplayResults.php#1346: PMA\libraries\DisplayResults->_getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `wp_options` ',
)
./libraries/DisplayResults.php#4424: PMA\libraries\DisplayResults->_getTableHeaders(
array,
array,
string 'SELECT * FROM `wp_options` ',
array,
array,
array,
boolean false,
)
./libraries/sql.lib.php#1686: PMA\libraries\DisplayResults->getTable(
,
array,
array,
boolean false,
)
./libraries/sql.lib.php#1980: PMA_getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
NULL,
array,
boolean true,
string '137',
integer 25,
NULL,
,
array,
)
./libraries/sql.lib.php#2199: PMA_getQueryResponseForResultsReturned(
,
array,
string 'dbcc',
string 'wp_options',
NULL,
NULL,
,
string './themes/pmahomme/img/',
string '137',
integer 25,
NULL,
NULL,
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_options`',
NULL,
)
./libraries/sql.lib.php#2062: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'dbcc',
string 'wp_options',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_options`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'dbcc',
string 'wp_options',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_options`',
NULL,
NULL,
)
What version of phpMyAdmin? You should make sure that you are running the latest version.
– Patrick QNov 25, 2019 at 19:13
- Are you using PHP 7.4? If so, see here. You may need to pull a 5.0 version from the downloads page. – Patrick Q Nov 26, 2019 at 19:16
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
);
@edit Using 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
);
in my code
– thank you, was helpful, I almost shed a tear /usr/share/phpmyadmin/libraries/DisplayResults.php
– Vasilii SuricovMay 28, 2021 at 6:14
14
I have also faced the same notice after upgrading php
7.2 to 7.4 on phpmyadmin
4.6
Below steps solved my issue.
- Install PPA by hiting
sudo add-apt-repository ppa:phpmyadmin/ppa
Check the issue here - Then run
sudo apt update
&sudo apt upgrade
- Finally restart your apache
sudo systemctl restart apache2
Now i am running phpmyadmin
4.9.5deb2 and notice gone
I am using php 7.4 on ubuntu 18.04. I got the same issue, and it has worked for me. My phpmyadmin server version: 5.7.35-0ubuntu0.18.04.1 – (Ubuntu)
–
it broke all the application that was there on server.
–
3
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
source : https://stackoverflow.com/questions/59038483/error-in-phpmyadmin-displayresults-php1226