WordPress.org

Ready to get started?Download WordPress

Forums

Participants Database
[resolved] wpdb::prepare error in WP 3.5 (4 posts)

  1. ricjoh
    Member
    Posted 1 year ago #

    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/

  2. lisaraquelle
    Member
    Posted 1 year ago #

    I get same warning: Warning: Missing argument 2 for wpdb::prepare(), ..... defined in wp-includes/wp-db.php on line 990

  3. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  4. ricjoh
    Member
    Posted 1 year ago #

    Thanks for your help! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.