2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Table/Column autocomplete in SQL editors
9 use PMA\libraries\Response
;
10 require_once 'libraries/common.inc.php';
12 if ($GLOBALS['cfg']['EnableAutocompleteForTablesAndColumns']) {
13 $db = isset($_POST['db']) ?
$_POST['db'] : $GLOBALS['db'];
14 $sql_autocomplete = array();
16 $tableNames = $GLOBALS['dbi']->getTables($db);
17 foreach ($tableNames as $tableName) {
18 $sql_autocomplete[$tableName] = $GLOBALS['dbi']->getColumns(
24 $sql_autocomplete = true;
26 $response = Response
::getInstance();
27 $response->addJSON("tables", json_encode($sql_autocomplete));