added method PMA_getTableFields

This commit is contained in:
Spun Nakandala 2013-07-30 19:14:02 +05:30
parent 721a44f0b4
commit 7d17bd34d7
2 changed files with 15 additions and 5 deletions

View File

@ -2372,4 +2372,18 @@ function PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData(
}
/**
* Function to get the fields of a table
*
* @param string $db current db
* @param string $table current table
*
* @return array
*/
function PMA_getTableFields($db, $table)
{
$GLOBALS['dbi']->selectDb($db);
return array_values($GLOBALS['dbi']->getColumns($db, $table));
}
?>

View File

@ -119,12 +119,8 @@ if (! empty($disp_message)) {
$response->addHTML(PMA_Util::getMessage($disp_message, null));
}
/**
* Get the list of the fields of the current table
*/
$GLOBALS['dbi']->selectDb($db);
$table_fields = array_values($GLOBALS['dbi']->getColumns($db, $table));
$table_fields = PMA_getTableFields($db, $table);
/**
* Determine what to do, edit or insert?