Merge remote-tracking branch 'origin/QA_4_0' into QA_4_0
[phpmyadmin.git] / db_sql.php
blobbaced44072f9fd99eb75596d47b23e910f72ae5d
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
11 require_once 'libraries/common.inc.php';
13 /**
14 * Runs common work
16 $response = PMA_Response::getInstance();
17 $header = $response->getHeader();
18 $scripts = $header->getScripts();
19 $scripts->addFile('functions.js');
20 $scripts->addFile('makegrid.js');
21 $scripts->addFile('sql.js');
23 require 'libraries/db_common.inc.php';
24 require_once 'libraries/sql_query_form.lib.php';
26 // After a syntax error, we return to this script
27 // with the typed query in the textarea.
28 $goto = 'db_sql.php';
29 $back = 'db_sql.php';
31 /**
32 * Sets globals from $_GET
35 $get_params = array(
36 'db_query_force'
39 foreach ($get_params as $one_get_param) {
40 if (isset($_GET[$one_get_param])) {
41 $GLOBALS[$one_get_param] = $_GET[$one_get_param];
45 /**
46 * Gets informations about the database and, if it is empty, move to the
47 * "db_structure.php" script where table can be created
49 require 'libraries/db_info.inc.php';
50 if ($num_tables == 0 && empty($db_query_force)) {
51 $sub_part = '';
52 $is_info = true;
53 include 'db_structure.php';
54 exit();
57 /**
58 * Query box, bookmark, insert data from textfile
60 PMA_sqlQueryForm(
61 true, false,
62 isset($_REQUEST['delimiter']) ? htmlspecialchars($_REQUEST['delimiter']) : ';'