@@ -485,13 +485,13 @@ public function getHtmlToDisplayPrivilegesTable(
485485 $ sqlQuery = 'SHOW COLUMNS FROM `mysql`. ' . ($ db === '* ' ? '`user` ' : '`db` ' ) . '; ' ;
486486
487487 $ res = $ this ->dbi ->query ($ sqlQuery );
488- while ($ row1 = $ res ->fetchRow () ) {
489- if (str_starts_with ($ row1 [ 0 ] , 'max_ ' )) {
490- $ row [$ row1 [ 0 ] ] = 0 ;
491- } elseif (str_starts_with ($ row1 [ 0 ] , 'x509_ ' ) || str_starts_with ($ row1 [ 0 ] , 'ssl_ ' )) {
492- $ row [$ row1 [ 0 ] ] = '' ;
488+ foreach ($ res ->fetchAllColumn () as $ colName ) {
489+ if (str_starts_with ($ colName , 'max_ ' )) {
490+ $ row [$ colName ] = 0 ;
491+ } elseif (str_starts_with ($ colName , 'x509_ ' ) || str_starts_with ($ colName , 'ssl_ ' )) {
492+ $ row [$ colName ] = '' ;
493493 } else {
494- $ row [$ row1 [ 0 ] ] = 'N ' ;
494+ $ row [$ colName ] = 'N ' ;
495495 }
496496 }
497497 } elseif ($ table === '* ' ) {
@@ -514,8 +514,8 @@ public function getHtmlToDisplayPrivilegesTable(
514514 . '. ' . Util::backquote ($ table ) . '; ' ,
515515 );
516516 if ($ res ) {
517- while ($ row1 = $ res ->fetchRow () ) {
518- $ columns [$ row1 [ 0 ] ] = [
517+ foreach ($ res ->fetchAllColumn () as $ colName ) {
518+ $ columns [$ colName ] = [
519519 'Select ' => false ,
520520 'Insert ' => false ,
521521 'Update ' => false ,
@@ -1704,12 +1704,12 @@ public function getHtmlForAllTableSpecificRights(
17041704
17051705 $ tables = [];
17061706 if ($ result ) {
1707- while ($ row = $ result ->fetchRow () ) {
1708- if (in_array ($ row [ 0 ] , $ foundRows , true )) {
1707+ foreach ($ result ->fetchAllColumn () as $ tableName ) {
1708+ if (in_array ($ tableName , $ foundRows , true )) {
17091709 continue ;
17101710 }
17111711
1712- $ tables [] = $ row [ 0 ] ;
1712+ $ tables [] = $ tableName ;
17131713 }
17141714 }
17151715
0 commit comments