Changeset 3124590
- Timestamp:
- 07/24/2024 12:07:52 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-database-backup/tags/6.12/includes/admin/cron-create-full-backup.php
r3124584 r3124590 395 395 $output = ''; 396 396 $sub_limit = 500; 397 //phpcs:ignore -- Use PHP methods for large files398 $check_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM %s", $table));397 //phpcs:ignore -- need to get all tables 398 $check_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `{$table}`")); 399 399 $check_count = intval($check_count); 400 400 … … 404 404 $sub_offset = $sub_i * $sub_limit; 405 405 // phpcs:ignore -- need to get chunk of data for selected table 406 $sub_result = $wpdb->get_results($wpdb->prepare("SELECT * FROM %s LIMIT %d OFFSET %d", $table, $sub_limit, $sub_offset), ARRAY_A);406 $sub_result = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$table}` LIMIT %d OFFSET %d", $sub_limit, $sub_offset), ARRAY_A); 407 407 if ($sub_result) { 408 408 $output .= wpdbbkp_create_sql_insert_statements($table, $sub_result); … … 412 412 } else { 413 413 // phpcs:ignore -- need to get all data for selected table 414 $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM %s", $table), ARRAY_A);414 $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$table}`"), ARRAY_A); 415 415 $output .= wpdbbkp_create_sql_insert_statements($table, $result); 416 416 } … … 418 418 419 419 // phpcs:ignore -- Get table structure for backup 420 $row2 = $wpdb->get_row($wpdb->prepare("SHOW CREATE TABLE %s", $table), ARRAY_N);420 $row2 = $wpdb->get_row($wpdb->prepare("SHOW CREATE TABLE `{$table}`"), ARRAY_N); 421 421 $output = "\n\n" . $row2[1] . ";\n\n" . $output; 422 422 … … 452 452 } 453 453 454 $logMessage .= "\nBackup completed for table: $table";454 $logMessage .= "\nBackup completed for table: {$table}"; 455 455 } 456 456
Note: See TracChangeset
for help on using the changeset viewer.