broken SQL since WP 4.8.2
-
Due to Changeset 41508(https://core.trac.www.ads-software.com/changeset/41508), which has been taken in WordPress 4.8.2, these codes no longer work.
$result1 = $wpdb->query( $wpdb->prepare( "INSERT INTO {$table}data (postid, day, last_viewed, pageviews) VALUES (%d, %s, %s, %d) ON DUPLICATE KEY UPDATE pageviews = pageviews + %4\$d, last_viewed = '%3\$s';", $id, $now, $now, $views ));
It seems to have been fixed like this.
$result1 = $wpdb->query( $wpdb->prepare( "INSERT INTO {$table}data (postid, day, last_viewed, pageviews) VALUES (%d, %s, %s, %d) ON DUPLICATE KEY UPDATE pageviews = pageviews + %d, last_viewed = '%s';", $id, $now, $now, $views, $views, $now ));
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘broken SQL since WP 4.8.2’ is closed to new replies.