Support » Plugin: Audit Trail » PHP warning in models/pager.php line 106

  • Ian Dunn


    Viewing the Audit Trail screen with PHP’s display_errors turned on reveals this error:

    Warning: Missing argument 2 for wpdb::prepare(), called in /var/www/vhosts/ on line 106 and defined in /var/www/vhosts/ on line 990

    WPDB::prepare() requires 2 arguments, so…

    $total_items  = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}audit_trail" ) );

    …should be changed to…

    $total_items  = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}audit_trail", null ) );

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PHP warning in models/pager.php line 106’ is closed to new replies.