$tableSelect = _("All Tables"); } $dumpBuffer .= '# ' . sprintf(_("Table Summary: %s"), $tableSelect) . DUMP_CRLF . '# ' . str_repeat('-', 45) . DUMP_CRLF; if (isset($_POST['create_db'])) { $dumpBuffer .= DUMP_CRLF . 'CREATE DATABASE ' . OPEN_DATABASE . ';' . DUMP_CRLF; } if (isset($_POST['use_dbname'])) { $dumpBuffer .= DUMP_CRLF . 'USE ' . OPEN_DATABASE . ';' . DUMP_CRLF; } for ($i = 0; $i < $numTables; $i++) { $table = $single ? $_POST['table_select'][$i] : $auxConn->tableName($i); if (isset($tmpSelect) && strpos(' ' . $tmpSelect, OPEN_SEPARATOR . $table . OPEN_SEPARATOR) || !isset($tmpSelect) && !empty($table)) { $formattedTableName = isset($_POST['use_backquotes']) ? Dump::backQuote($table) : '"' . $table . '"'; // If only datas, no need to displays table name if ($_POST['what'] != 'dataonly') { $dumpBuffer .= DUMP_CRLF . '#' . DUMP_CRLF . '# ' . sprintf(_("Table structure for table %s"), $formattedTableName) . DUMP_CRLF . '#' . DUMP_CRLF . DUMP_CRLF . Dump::SQLDefinition(OPEN_DATABASE, $table, array('drop' => isset($_POST['drop']) ? $_POST['drop'] : null, 'use_backquotes' => isset($_POST['use_backquotes']) ? $_POST['use_backquotes'] : null)) . ';' . DUMP_CRLF; } // At least data if ($_POST['what'] == 'data' || $_POST['what'] == 'dataonly') { $dumpBuffer .= DUMP_CRLF . '#' . DUMP_CRLF . '# ' . sprintf(_("Dumping data for table %s"), $formattedTableName) . DUMP_CRLF . '#' . DUMP_CRLF . DUMP_CRLF; if ($_POST['what'] == 'dataonly' && isset($_POST['add_delete'])) { $dumpBuffer .= 'DELETE * FROM ' . $formattedTableName . ';' . DUMP_CRLF . DUMP_CRLF; } if (!isset($limitFrom) || !isset($limitTo)) { $limitFrom = $limitTo = 0; } $dumpBuffer .= Dump::SQLData(OPEN_DATABASE, $table, array('from' => $limitFrom, 'to' => $limitTo, 'use_backquotes' => isset($_POST['use_backquotes']) ? $_POST['use_backquotes'] : null, 'show_columns' => isset($_POST['show_columns']) ? $_POST['show_columns'] : null, 'extended_inserts' => isset($_POST['extended_inserts']) ? $_POST['extended_inserts'] : null)); } // end if } // end if