The branch, master has been updated
via c4c445b0e9ba76f53de048d1b322595c06ebce26 (commit)
via 5209562dd3504c160f26f3d6466683fda7cdabfc (commit)
from cea5d8791ef776dc87961ae4f69c393acdffe381 (commit)
- Log -----------------------------------------------------------------
commit c4c445b0e9ba76f53de048d1b322595c06ebce26
Author: Michal Čihař <[email protected]>
Date: Fri Aug 19 09:20:23 2011 +0200
Use PMA_DBI_get_columns instead of custom query
commit 5209562dd3504c160f26f3d6466683fda7cdabfc
Author: Michal Čihař <[email protected]>
Date: Fri Aug 19 09:18:27 2011 +0200
Use PMA_DBI_get_columns instead of custom query
-----------------------------------------------------------------------
Summary of changes:
libraries/sql_query_form.lib.php | 4 +---
libraries/tbl_select.lib.php | 7 ++-----
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php
index 542cfc3..beab95d 100644
--- a/libraries/sql_query_form.lib.php
+++ b/libraries/sql_query_form.lib.php
@@ -213,9 +213,7 @@ function PMA_sqlQueryFormInsert($query = '',
$is_querywindow = false, $delimiter
// Get the list and number of fields
// we do a try_query here, because we could be in the query window,
// trying to synchonize and the table has not yet been created
- $fields_list = PMA_DBI_fetch_result(
- 'SHOW FULL COLUMNS FROM ' . PMA_backquote($db)
- . '.' . PMA_backquote($GLOBALS['table']));
+ $fields_list = PMA_DBI_get_columns($db, $GLOBALS['table'], true);
$tmp_db_link = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase']
. '?' . PMA_generate_common_url($db) . '"';
diff --git a/libraries/tbl_select.lib.php b/libraries/tbl_select.lib.php
index af97aa4..57c520d 100644
--- a/libraries/tbl_select.lib.php
+++ b/libraries/tbl_select.lib.php
@@ -59,12 +59,11 @@ function PMA_tbl_getFields($table,$db) {
// Gets the list and number of fields
- $result = PMA_DBI_query('SHOW FULL FIELDS FROM ' .
PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';', null,
PMA_DBI_QUERY_STORE);
- $fields_cnt = PMA_DBI_num_rows($result);
+ $fields = PMA_DBI_get_columns($db, $table, true);
$fields_list = $fields_null = $fields_type = $fields_collation = array();
$geom_column_present = false;
$geom_types = PMA_getGISDatatypes();
- while ($row = PMA_DBI_fetch_assoc($result)) {
+ foreach ($fields as $row) {
$fields_list[] = $row['Field'];
$type = $row['Type'];
// check whether table contains geometric columns
@@ -96,8 +95,6 @@ function PMA_tbl_getFields($table,$db) {
? $row['Collation']
: '';
} // end while
- PMA_DBI_free_result($result);
- unset($result, $type);
return array($fields_list,$fields_type,$fields_collation,$fields_null,
$geom_column_present);
hooks/post-receive
--
phpMyAdmin
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Phpmyadmin-git mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-git