From c63474bde1864a01cc6ab307e3728bef5abeec44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 4 Aug 2011 15:47:07 +0200 Subject: [PATCH] Use PMA_DBI_get_columns --- tbl_structure.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tbl_structure.php b/tbl_structure.php index 77e9b39631..85ecf08a47 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -123,10 +123,8 @@ foreach (PMA_Index::getFromTable($table, $db) as $index) { unset($index, $columns, $column_name, $dummy); // 3. Get fields -$fields_rs = PMA_DRIZZLE - ? PMA_DBI_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE) - : PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE); -$fields_cnt = PMA_DBI_num_rows($fields_rs); +$fields = PMA_DBI_get_columns($db, $table, !PMA_DRIZZLE); +$fields_cnt = count($fields); // Get more complete field information // For now, this is done just for MySQL 4.1.2+ new TIMESTAMP options @@ -243,7 +241,7 @@ $aryFields = array(); $checked = (!empty($checkall) ? ' checked="checked"' : ''); $save_row = array(); $odd_row = true; -while ($row = PMA_DBI_fetch_assoc($fields_rs)) { +foreach ($fields as $row) { $save_row[] = $row; $rownum++; $aryFields[] = $row['Field']; @@ -575,7 +573,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { ' . "\n" .'' . "\n";