Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dumpFormat() {
- return parent::dumpFormat() + array('xml' => 'XML');
- }
- function dumpData($table, $style, $query) {
- if ($_POST["format"] == "xml") {
- echo "<database name='" . h(DB) . "'>\n";
- $connection = connection();
- $result = $connection->query($query, 1);
- if ($result) {
- while ($row = $result->fetch_assoc()) {
- echo "\t<table name='" . h($table) . "'>\n";
- foreach ($row as $key => $val) {
- echo "\t\t<column name='" . h($key) . "'>" . h($val) . "</column>\n";
- }
- echo "\t</table>\n";
- }
- }
- echo "</database>\n";
- } else {
- return parent::dumpData($table, $style, $query);
- }
- }
- function dumpHeaders($identifier, $multi_table = false) {
- if ($_POST["format"] == "xml") {
- header("Content-Type: text/xml; charset=utf-8");
- } else {
- return parent::dumpHeaders($identifier, $multi_table);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement