Skip to content

Commit

Permalink
Updating sql query for backward compatibility with older mysql versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbossenger committed May 25, 2018
1 parent 0790b9a commit 7ee960f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-ssp-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 7ee960f

Please sign in to comment.