WordPress.org

Forums

Warning: Missing argument 2 for wpdb::prepare() (2 posts)

  1. Grafikz
    Member
    Posted 1 year ago #

    I know it is posted several times and that it has to do with the upgrade to WordPress 3.6. But as i am not a programmer / developer, i hope to get some help to fix this problem.

    I would like to run GTM System buddypress on my install. Several errors i allready fixed, but still get this one:

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/leader/public_html/xxxxx/wp-content/plugins/bp-gtm-system/lib/roles.php on line 267 and defined in /home/leader/public_html/xxxxx/wp-includes/wp-db.php on line 992

    If i look to the code on that line:

    $exist = $wpdb->query($wpdb->prepare("
    SELECT id
    FROM {$bp->gtm->table_roles_caps}
    WHERE group_id = $group_id AND user_id = $user_id"));

    and same kind of error for line 293:

    if(!$exist){
    $result = $wpdb->query($wpdb->prepare("
    INSERT INTO {$bp->gtm->table_roles_caps}
    (user_id,group_id, role_id)
    VALUES ($user_id, $group_id, $role_id)"));

    Can some help me to get the code right?

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    Is the plugin still under active development? It's compatible up to WordPress 3.3, Buddypress 1.5.4. I recommend you find a plugin that is more up to date.

    This warning was introduced in WordPress 3.5.
    http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

Topic Closed

This topic has been closed to new replies.

About this Topic