WordPress.org

Ready to get started?Download WordPress

Forums

Simple Ads Manager
"Missing argument 2 for wpdb::prepare()" after wordpress update (7 posts)

  1. majato
    Member
    Posted 1 year ago #

    After updating to WordPress 3.5 I get the following errors:-

    Warning: Missing argument 2 for wpdb::prepare() called in /wp-content/plugins/simple-ads-manager/list.admin.class.php on line 118 and defined in /wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-ads-manager/list.admin.class.php on line 119 and defined in /wp-includes/wp-db.php on line 990

    This occurs with both 1.7.57 and previous version.

    http://wordpress.org/extend/plugins/simple-ads-manager/

  2. pabloseidel
    Member
    Posted 1 year ago #

    The same thing happened with me, and after changing some codes in some php files the problem seems to be fixed. I hope that a new version of the plugin will be available so we can just update it and all files will be fixed at once.

    Despite the error, looks like the plugin works normally.

  3. B_Dark
    Member
    Posted 1 year ago #

    i got the same warning msg on mysite.com/wp-admin/admin.php?page=sam-list

  4. tm8228
    Member
    Posted 1 year ago #

    Hi,

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

    and then change in
    /wordpress/wp-content/plugins/simple-ads-manager/list.admin.class.php

    lines 118 and 119 to

    $trash_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = %s', TRUE));
    $active_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = %s', FALSE));

  5. B_Dark
    Member
    Posted 1 year ago #

    on line 118 & 119 is
    $all_num = $trash_num + $active_num;
    $total = (($mode !== 'all') ? (($mode === 'trash') ? $trash_num : $active_num) : $all_num);
    right?

  6. tm8228
    Member
    Posted 1 year ago #

    ... no, sorry, not in my case.

    Search for
    $trash_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = TRUE));
    and
    $active_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = FALSE));

    Should be 3 lines or so above ...

  7. rbiard
    Member
    Posted 1 year ago #

    This does not completely fix the problem.
    If you click on the settings tab, you still get errors about unknown variables of instance.
    But thanks anyway for this tip.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.