Chris@76: '')); Chris@76: $dbp = str_replace('_', '\_', $match[2]); Chris@76: } Chris@76: else Chris@76: { Chris@76: $db = false; Chris@76: $dbp = $db_prefix; Chris@76: } Chris@76: Chris@76: // Dump each table. Chris@76: $tables = $smcFunc['db_list_tables'](false, $db_prefix . '%'); Chris@76: foreach ($tables as $tableName) Chris@76: { Chris@76: if (function_exists('apache_reset_timeout')) Chris@76: @apache_reset_timeout(); Chris@76: Chris@76: // Are we dumping the structures? Chris@76: if (isset($_REQUEST['struct'])) Chris@76: { Chris@76: echo Chris@76: $crlf, Chris@76: '--', $crlf, Chris@76: '-- Table structure for table `', $tableName, '`', $crlf, Chris@76: '--', $crlf, Chris@76: $crlf, Chris@76: $smcFunc['db_table_sql']($tableName), ';', $crlf; Chris@76: } Chris@76: Chris@76: // How about the data? Chris@76: if (!isset($_REQUEST['data']) || substr($tableName, -10) == 'log_errors') Chris@76: continue; Chris@76: Chris@76: // Are there any rows in this table? Chris@76: $get_rows = $smcFunc['db_insert_sql']($tableName); Chris@76: Chris@76: // No rows to get - skip it. Chris@76: if (empty($get_rows)) Chris@76: continue; Chris@76: Chris@76: echo Chris@76: $crlf, Chris@76: '--', $crlf, Chris@76: '-- Dumping data in `', $tableName, '`', $crlf, Chris@76: '--', $crlf, Chris@76: $crlf, Chris@76: $get_rows, Chris@76: '-- --------------------------------------------------------', $crlf; Chris@76: } Chris@76: Chris@76: echo Chris@76: $crlf, Chris@76: '-- Done', $crlf; Chris@76: Chris@76: exit; Chris@76: } Chris@76: Chris@76: ?>