Support » Plugin: Participants Database » wpdb::prepare error in WP 3.5

  • Resolved ricjoh

    (@ricjoh)


    Warning: Missing argument 2 for wpdb::prepare(), called in /web/html/testwp.xymmetrix.com/wp-content/plugins/participants-database/manage_fields.php on line 407 and defined in /web/html/testwp.xymmetrix.com/wp-includes/wp-db.php on line 990

    In this URL:
    /wp-admin/admin.php?page=participants-database-manage_fields

    Apparently wpdb::prepare has changed in WP 3.5

    http://wordpress.org/extend/plugins/participants-database/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I get same warning: Warning: Missing argument 2 for wpdb::prepare(), ….. defined in wp-includes/wp-db.php on line 990

    Plugin Author xnau webdesign

    (@xnau)

    Yeah, this is new. You can safely ignore it…if it’s showing up on your web pages, you should disable the PHP setting ‘display_errors’ to ‘off’

    I will have this fixed in the next release., but if you want to fix it yourself, you can do this:

    In the plugin file manage_fields.php on line 407 you’ll see:

    $group_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM '.Participants_Db::$fields_table.' WHERE group = "' . $group.'"' ) );

    change it to:

    $group_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM '.Participants_Db::$fields_table.' WHERE group = "%s"', $group ) );

    The word ‘group’ after ‘WHERE’ should probably have backticks around it…but I can’t post backticks in the forum here.

    Thanks for your help! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wpdb::prepare error in WP 3.5’ is closed to new replies.