WordPress.org

Ready to get started?Download WordPress

Forums

Cimy User Extra Fields
[resolved] Warning: Missing argument 2 for wpdb::prepare() (7 posts)

  1. Max Pen
    Member
    Posted 1 year ago #

    Warning: Missing argument 2 for wpdb::prepare(), called in public_html/wp-content/plugins/cimy-user-extra-fields/cimy_uef_profile.php on line 101 and defined in public_html/wp-includes/wp-db.php on line 990

    Can you fix? That displays on edit profile in dashboard at the location above the custom fields.

    http://wordpress.org/extend/plugins/cimy-user-extra-fields/

  2. spitgray3
    Member
    Posted 1 year ago #

  3. Max Pen
    Member
    Posted 1 year ago #

    I did the wp-config.php edit. So now I do not have any sql vurnability anymore?

  4. pouyanafisi
    Member
    Posted 1 year ago #

    It is only a warning, no reason to panic. With that said I understand your frustration, like you i don't like notices or warnings. I like everything to perform "issue" free.

    The issue here is as simple as an argument not being set for the prepare function. As of wordpress 3.5 wpdb::prepare() enforces a minimum of two arguments. you can read more here:

    http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

    to fix this simple make this change:

    In /plugins/cimy-user-extra-fields/cimy_uef_profile.php
    on line 101 change

    $value = $wpdb->get_var($wpdb->prepare("SELECT VALUE FROM ".$wpdb_data_table." WHERE USER_ID=".$get_user_id." AND FIELD_ID=".$field_id));

    to

    $value = $wpdb->get_var($wpdb->prepare("SELECT VALUE FROM ".$wpdb_data_table." WHERE USER_ID=".$get_user_id." AND FIELD_ID=".$field_id,0));

    and line 105

    $radio_checked[$name] = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb_data_table." WHERE USER_ID=".$get_user_id." AND FIELD_ID=".$field_id." AND VALUE=\"selected\""));

    to

    $radio_checked[$name] = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb_data_table." WHERE USER_ID=".$get_user_id." AND FIELD_ID=".$field_id." AND VALUE=\"selected\"",0));

  5. Max Pen
    Member
    Posted 1 year ago #

    Thank you very much. Solved.

  6. abhijotesingh
    Member
    Posted 12 months ago #

    Please help me .. its really urgent got an error

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/wikips9x/public_html/hotelinternational.in/wp-content/themes/welcome_inn/library/tfuse_framework/functions/core.php on line 21 and defined in /home/wikips9x/public_html/hotelinternational.in/wp-includes/wp-db.php on line 992

  7. Marco Cimmino
    Member
    Plugin Author

    Posted 12 months ago #

    @abhijotesingh
    This is a topic regarding Cimy User Extra Fields plug-in, you are talking about problems on 'welcome_inn' theme which is totally off topic here.
    Open a new thread please!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.