Permalink
Switch branches/tags
RELEASE_3_5_0 RELEASE_3_5_0RC2 RELEASE_3_5_0RC1 RELEASE_3_5_0BETA1 RELEASE_3_5_0ALPHA1 RELEASE_3_4_11 RELEASE_3_4_11RC1 RELEASE_3_4_10_2 RELEASE_3_4_10_1 RELEASE_3_4_10 RELEASE_3_4_10RC1 RELEASE_3_4_9 RELEASE_3_4_9RC1 RELEASE_3_4_8 RELEASE_3_4_8RC1 RELEASE_3_4_7_1 RELEASE_3_4_7 RELEASE_3_4_7RC1 RELEASE_3_4_6 RELEASE_3_4_6RC1 RELEASE_3_4_5 RELEASE_3_4_5RC1 RELEASE_3_4_4 RELEASE_3_4_4RC1 RELEASE_3_4_3_2 RELEASE_3_4_3_1 RELEASE_3_4_3 RELEASE_3_4_3RC1 RELEASE_3_4_2 RELEASE_3_4_2RC1 RELEASE_3_4_1 RELEASE_3_4_1RC1 RELEASE_3_4_0 RELEASE_3_4_0RC2 RELEASE_3_4_0RC1 RELEASE_3_4_0BETA4 RELEASE_3_4_0BETA3 RELEASE_3_4_0BETA2 RELEASE_3_4_0BETA1 RELEASE_3_4_0ALPHA2 RELEASE_3_4_0ALPHA1 RELEASE_3_3_10_5 RELEASE_3_3_10_4 RELEASE_3_3_10_3 RELEASE_3_3_10_2 RELEASE_3_3_10_1 RELEASE_3_3_10 RELEASE_3_3_10RC1 RELEASE_3_3_9_2 RELEASE_3_3_9_1 RELEASE_3_3_9 RELEASE_3_3_9RC1 RELEASE_3_3_8_1 RELEASE_3_3_8 RELEASE_3_3_8RC1 RELEASE_3_3_7 RELEASE_3_3_7RC1 RELEASE_3_3_6 RELEASE_3_3_6RC1 RELEASE_3_3_5_1 RELEASE_3_3_5 RELEASE_3_3_5RC1 RELEASE_3_3_4 RELEASE_3_3_4RC1 RELEASE_3_3_3 RELEASE_3_3_3RC1 RELEASE_3_3_2 RELEASE_3_3_2RC1 RELEASE_3_3_1 RELEASE_3_3_1RC1 RELEASE_3_3_0 RELEASE_3_3_0RC3 RELEASE_3_3_0RC2 RELEASE_3_3_0RC1 RELEASE_3_3_0BETA1 RELEASE_3_3_0ALPHA1 RELEASE_3_2_5 RELEASE_3_2_5RC2 RELEASE_3_2_5RC1 RELEASE_3_2_4 RELEASE_3_2_4RC1 RELEASE_3_2_3 RELEASE_3_2_3RC1 RELEASE_3_2_2_1 RELEASE_3_2_2 RELEASE_3_2_2RC1 RELEASE_3_2_0_1 RELEASE_3_2_0 RELEASE_3_2_0RC1 RELEASE_3_2_0BETA1 RELEASE_3_1_5 RELEASE_3_1_5RC1 RELEASE_3_1_4 RELEASE_3_1_4RC2 RELEASE_3_1_4RC1 RELEASE_3_1_3_2 RELEASE_3_1_3_1 RELEASE_3_1_3 RELEASE_3_1_3RC1 RELEASE_3_1_2
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (78 sloc) 2.71 KB
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @package PhpMyAdmin
*/
/**
*
*/
require_once 'libraries/common.inc.php';
$GLOBALS['js_include'][] = 'export.js';
if ($GLOBALS['cfg']['CodemirrorEnable']) {
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
}
/**
* Gets tables informations and displays top links
*/
require_once 'libraries/tbl_common.php';
$url_query .= '&amp;goto=tbl_export.php&amp;back=tbl_export.php';
require_once 'libraries/tbl_info.inc.php';
// Dump of a table
$export_page_title = __('View dump (schema) of table');
// When we have some query, we need to remove LIMIT from that and possibly
// generate WHERE clause (if we are asked to export specific rows)
if (! empty($sql_query)) {
// Parse query so we can work with tokens
$parsed_sql = PMA_SQP_parse($sql_query);
$analyzed_sql = PMA_SQP_analyze($parsed_sql);
// Need to generate WHERE clause?
if (isset($where_clause)) {
// Yes => rebuild query from scratch; this doesn't work with nested
// selects :-(
$sql_query = 'SELECT ';
if (isset($analyzed_sql[0]['queryflags']['distinct'])) {
$sql_query .= ' DISTINCT ';
}
$sql_query .= $analyzed_sql[0]['select_expr_clause'];
if (!empty($analyzed_sql[0]['from_clause'])) {
$sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
}
$wheres = array();
if (isset($where_clause) && is_array($where_clause)
&& count($where_clause) > 0) {
$wheres[] = '(' . implode(') OR (', $where_clause) . ')';
}
if (!empty($analyzed_sql[0]['where_clause'])) {
$wheres[] = $analyzed_sql[0]['where_clause'];
}
if (count($wheres) > 0) {
$sql_query .= ' WHERE (' . implode(') AND (', $wheres) . ')';
}
if (!empty($analyzed_sql[0]['group_by_clause'])) {
$sql_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];
}
if (!empty($analyzed_sql[0]['having_clause'])) {
$sql_query .= ' HAVING ' . $analyzed_sql[0]['having_clause'];
}
if (!empty($analyzed_sql[0]['order_by_clause'])) {
$sql_query .= ' ORDER BY ' . $analyzed_sql[0]['order_by_clause'];
}
} else {
// Just crop LIMIT clause
$sql_query = $analyzed_sql[0]['section_before_limit'] . $analyzed_sql[0]['section_after_limit'];
}
$message = PMA_Message::success();
}
/**
* Displays top menu links
*/
require 'libraries/tbl_links.inc.php';
$export_type = 'table';
require_once 'libraries/display_export.lib.php';
/**
* Displays the footer
*/
require 'libraries/footer.inc.php';
?>