• Resolved THEGrizz

    (@thegrizz)


    I upgraded to from 3.4.2 to 3.5 yesterday and now I’m getting these errors when new members register for my site 🙁 Anyone willing to help???

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/03/10010703/html/pcvdo/wp-content/plugins/membership/membershipincludes/classes/membershipadmin.php on line 4898 and defined in /home/content/03/10010703/html/pcvdo/wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/03/10010703/html/pcvdo/wp-content/plugins/membership/membershipincludes/classes/membershipadmin.php on line 4904 and defined in /home/content/03/10010703/html/pcvdo/wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/03/10010703/html/pcvdo/wp-content/plugins/membership/membershipincludes/classes/membershipadmin.php on line 4855 and defined in /home/content/03/10010703/html/pcvdo/wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/03/10010703/html/pcvdo/wp-content/plugins/membership/membershipincludes/classes/membershipadmin.php on line 4791 and defined in /home/content/03/10010703/html/pcvdo/wp-includes/wp-db.php on line 990

Viewing 15 replies - 1 through 15 (of 19 total)
  • Your site is fine, but you may wish to turn off PHP’s display errors setting. Contact your theme or plugin dev and point them to http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/ so they can fix the underlying issue.

    Thread Starter THEGrizz

    (@thegrizz)

    Thank you songdogtech! The plug-in worked just fine until I upgrade to 3.5. I had a member register tonight that pointed it out to me. Thanks again!!

    Hi,

    I am also getting EXACTLY the same error after I upgraded to 3.5. Please help me.

    Just to update, I am seeing this error on certain themes only especially themes from one particular developer (blocks, blocks2, elegent box etc)

    If I choose some other themes, this error disappears but I somehow don’t want to change the theme. Please help.

    Found the solution 🙂

    The theme file (mentioned in the error) was using $wpdb->prepare in insecure manner. Changing following did the trick. The warning was earlier being issued by wordpress since it now wants developers to parse variables securely instead of directly parsing in the statement. So another argument is a must in $wpdb->prepare call in such cases.

    For example you can change
    $wpdb->prepare( “SELECT * FROM table WHERE id = $id” );
    to
    $wpdb->prepare( “SELECT * FROM table WHERE id = %d”, $id );

    Cheers,
    Tushar

    Hello, I am getting the same notification on my WP dashboard when i log in. And I seems to be experiencing other difficulties as well – like can’t upload photos. I am wondering if you could explain in novice-friendly terms what can I do to fix this, possibly through the WP dashboard itself rather then ftp login?

    Thank you for your help.

    Aleksa.

    See the link I posted above earlier and below. Your site is fine, but you may wish to turn off PHP’s display errors setting. Contact your theme or plugin dev and point them to http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/ so they can fix the underlying issue. And read http://wordpress.org/support/topic/troubleshooting-wordpress-35-master-list?replies=4

    The solution that @tushar43 posted work great!

    HELP!
    I don’t understand any of the above. I can’t contact my theme or plug dev because there is no one to contact. I don’t even know who my plug dev is!! what do I do?

    @bridalbebonheur

    ideally, start your own topic;
    in any case, post more details, such as which theme you are using, and the exact warning message, and which plugins are involved….

    Hi, I have this message
    Warning: Missing argument 2 for wpdb::prepare(), called in /home/zlcenerg/public_html/wp-content/themes/zlc/page-tertiary-a.php on line 60 and defined in /home/zlcenerg/public_html/wp-includes/wp-db.php on line 990

    I think I’ve found the correct line, and looking at tushar43’s post, I’m wondering if it could be this bit of code –

    “SELECT * FROM $wpdb->posts WHERE guid = ‘$cross_a_image'”

    However, am a complete novice, and really have no idea, so just making a vaguely informed guess from searching through posts!
    Any help greatly appreciated! Thanks
    http://www.zlcenergy.co.uk/contact-us/arrange-survey/

    oh, also, from looking at the page of code, it looks like it could be something from yoast,<?php if ( function_exists(‘yoast_breadcrumb’) ) {
    yoast_breadcrumb(‘<p id=”breadcrumbs”>’,'</p>’);
    } ?>

    but wouldn’t have any idea about how to contact them or if it’s even a plug in of theirs, I didn’t originally set up the plug in…?!

    See the codex for information on proper use of wpdp->prepare with php variables: http://codex.wordpress.org/Class_Reference/wpdb

    Easy update Post Types Order version on wordpress ==>> fix Missing argument 2 for wpdb::prepare(),

    @seo PBS Can you elaborate on the “Easy update”?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Missing argument 2 for wpdb::prepare(),’ is closed to new replies.