forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_multi_table_query.php
More file actions
58 lines (51 loc) · 1.47 KB
/
db_multi_table_query.php
File metadata and controls
58 lines (51 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* query by example the whole database
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Database\MultiTableQuery;
use PhpMyAdmin\ParseAnalyze;
use PhpMyAdmin\Response;
use PhpMyAdmin\Sql;
require_once 'libraries/common.inc.php';
if (isset($_REQUEST['sql_query'])) {
$sql_query = $_REQUEST['sql_query'];
$db = $_REQUEST['db'];
list(
$analyzed_sql_results,
$db,
$table_from_sql
) = ParseAnalyze::sqlQuery($sql_query, $db);
extract($analyzed_sql_results);
$goto = 'db_multi_table_query.php';
$html_output = Sql::executeQueryAndSendQueryResponse(
null, // analyzed_sql_results
false, // is_gotofile
$db, // db
null, // table
null, // find_real_end
null, // sql_query_for_bookmark - see below
null, // extra_data
null, // message_to_show
null, // message
null, // sql_data
$goto, // goto
$pmaThemeImage, // pmaThemeImage
null, // disp_query
null, // disp_message
null, // query_type
$sql_query, // sql_query
null, // selectedTables
null // complete_query
);
exit;
}
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery.md5.js');
$scripts->addFile('db_multi_table_query.js');
$QueryInstance = new MultiTableQuery($db);
$response->addHTML($QueryInstance->getFormHTML());