0 ) { $num_fields = (int) $_REQUEST['num_fields']; } else { $num_fields = 4; } return $num_fields; } /** * Function to execute the column creation statement * * @param string $db current database * @param string $table current table * @param string $err_url error page url * * @return array */ function PMA_tryColumnCreationQuery($db, $table, $err_url) { // get column addition statements $sql_statement = PMA_getColumnCreationStatements(false); // To allow replication, we first select the db to use and then run queries // on this db. $GLOBALS['dbi']->selectDb($db) or PMA_Util::mysqlDie( $GLOBALS['dbi']->getError(), 'USE ' . PMA_Util::backquote($db), false, $err_url ); $sql_query = 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ' . $sql_statement . ';'; // If there is a request for SQL previewing. if (isset($_REQUEST['preview_sql'])) { PMA_previewSQL($sql_query); } return array($GLOBALS['dbi']->tryQuery($sql_query) , $sql_query); } ?>