From 7ee960f7486d0b1c833973b7b4a8e5daa56cc57e Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Fri, 25 May 2018 15:30:54 +0200 Subject: [PATCH] Updating sql query for backward compatibility with older mysql versions --- includes/class-ssp-stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-ssp-stats.php b/includes/class-ssp-stats.php index 6fcbe74..c980dab 100755 --- a/includes/class-ssp-stats.php +++ b/includes/class-ssp-stats.php @@ -1490,7 +1490,7 @@ public function maybe_update_stats_data(){ } global $wpdb; - $query = "UPDATE {$wpdb->prefix}ssp_stats SET ip_address = REPLACE(ip_address, SUBSTRING_INDEX(ip_address,'.',-1), '0')"; + $query = "UPDATE {$wpdb->prefix}ssp_stats SET ip_address = CONCAT( SUBSTRING_INDEX( ip_address, '.', 3 ) , '.0' )"; $affected_rows = $wpdb->query($query); if (false === $affected_rows){