Produces WP DB Error
Download.php produces this error:
Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/download-monitor/download.php on line 208
This is because $wpdb->prepare is not formatted properly. Line 208 shows:
$old_date = $wpdb->get_var( $wpdb->prepare( “SELECT date FROM $wp_dlm_db_log WHERE ip_address = ‘$ipAddress’ AND download_id = “.$d->id.” ORDER BY date DESC limit 1;”) );
It should be:
$old_date = $wpdb->get_var( $wpdb->prepare( “SELECT date FROM $wp_dlm_db_log WHERE ip_address = %d AND download_id = %s ORDER BY date DESC limit 1;”, $ipAddress, $d->id) );
I fixed it on my site and it works fine once the proper syntax is used.
More information about this can be found here:
- The topic ‘Produces WP DB Error’ is closed to new replies.