From a251ae6ad0595c39d952bbb670b46c1bd3dbbb8d Mon Sep 17 00:00:00 2001 From: brazenest Date: Wed, 4 Feb 2015 07:04:09 -0700 Subject: [PATCH] Fix table name in 404s export SQL This corrects the SQL statement to retrieve the number of 404s for export to CSV. The correct table name is 'redirection_404', not 'redirection_logs'. Per issue: https://github.com/johngodley/redirection/issues/39 --- models/log.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/log.php b/models/log.php index 5632772c..056950f4 100644 --- a/models/log.php +++ b/models/log.php @@ -241,7 +241,7 @@ static function export_to_csv() { fputcsv( $stdout, array( 'date', 'source', 'ip', 'referrer' ) ); $extra = ''; - $sql = "SELECT COUNT(*) FROM {$wpdb->prefix}redirection_logs"; + $sql = "SELECT COUNT(*) FROM {$wpdb->prefix}redirection_404"; if ( isset( $_REQUEST['s'] ) ) $extra = $wpdb->prepare( " WHERE url LIKE %s", '%'.like_escape( $_REQUEST['s'] ).'%' );