Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Przybylski <piotrprz@gmail.com>2011-08-04 22:19:43 +0400
committerPiotr Przybylski <piotrprz@gmail.com>2011-08-04 22:19:43 +0400
commit66665f326ae28740ea10939feebe223b702943b8 (patch)
tree5afaa242e8d25148b9ab5c3648a0754b6de46d53 /tbl_printview.php
parent3fa5e89bb29bb481576a2cf81d3364402bef8dcf (diff)
parent4c62a5fed6efe79b9ab9c667458d365058a914dc (diff)
Merge remote-tracking branch 'origin/master' into drizzle
Conflicts: db_qbe.php js/server_status.js libraries/export/xml.php libraries/schema/Pdf_Relation_Schema.class.php tbl_printview.php tbl_structure.php
Diffstat (limited to 'tbl_printview.php')
-rw-r--r--tbl_printview.php47
1 files changed, 7 insertions, 40 deletions
diff --git a/tbl_printview.php b/tbl_printview.php
index 1e138588bb..9ece0c37fd 100644
--- a/tbl_printview.php
+++ b/tbl_printview.php
@@ -51,7 +51,7 @@ PMA_DBI_select_db($db);
/**
- * Multi-tables printview
+ * Multi-tables printview
*/
if (isset($selected_tbl) && is_array($selected_tbl)) {
$the_tables = $selected_tbl;
@@ -98,10 +98,7 @@ foreach ($the_tables as $key => $table) {
/**
* Gets fields properties
*/
- $result = PMA_DBI_query(
- PMA_DBI_get_columns_sql($db, $table), null,
- PMA_DBI_QUERY_STORE);
- $fields_cnt = PMA_DBI_num_rows($result);
+ $columns = PMA_DBI_get_columns($db, $table);
// We need this to correctly learn if a TIMESTAMP is NOT NULL, since
@@ -155,40 +152,11 @@ foreach ($the_tables as $key => $table) {
</thead>
<tbody>
<?php
- while ($row = PMA_DBI_fetch_assoc($result)) {
- $type = $row['Type'];
- // reformat mysql query output
- // set or enum types: slashes single quotes inside options
- if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp)) {
- $tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'',
- ',' . $tmp[2]), 1);
- $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
-
- $binary = 0;
- $unsigned = 0;
- $zerofill = 0;
- } else {
- $type = preg_replace('@BINARY@i', '', $type);
- $type = preg_replace('@ZEROFILL@i', '', $type);
- $type = preg_replace('@UNSIGNED@i', '', $type);
- if (empty($type)) {
- $type = '&nbsp;';
- }
+ foreach ($columns as $row) {
+ $extracted_fieldspec = PMA_extractFieldSpec($row['Type']);
+ $type = $extracted_fieldspec['print_type'];
+ $attribute = $extracted_fieldspec['attribute'];
- $binary = stristr($row['Type'], 'binary');
- $unsigned = stristr($row['Type'], 'unsigned');
- $zerofill = stristr($row['Type'], 'zerofill');
- }
- $attribute = '&nbsp;';
- if ($binary) {
- $attribute = 'BINARY';
- }
- if ($unsigned) {
- $attribute = 'UNSIGNED';
- }
- if ($zerofill) {
- $attribute = 'UNSIGNED ZEROFILL';
- }
if (! isset($row['Default'])) {
if ($row['Null'] != '' && $row['Null'] != 'NO') {
$row['Default'] = '<i>NULL</i>';
@@ -252,8 +220,7 @@ foreach ($the_tables as $key => $table) {
?>
</tr>
<?php
- } // end while
- PMA_DBI_free_result($result);
+ } // end foreach
?>
</tbody>
</table>