Ad renew throwing error

Discussion in 'ClassiCraft WordPress Theme' started by themotorcycledude, Aug 14, 2013.

  1. themotorcycledude

    themotorcycledude Member

    Joined:
    Jul 11, 2013
    Messages:
    83
    Likes Received:
    0
    I went to renew an ad and I got the error shown in the screenshot. The function you have is:

    function gc_renewal_periond() {
    global $wpdb, $price_table_name;
    $sql = "SELECT * FROM $price_table_name";
    $QUERY = $wpdb->get_results($wpdb->prepare($sql));
    foreach ($QUERY as $q) {
    if ($q->package_type == "pkg_free") {
    if ($q->renewal_cycle == "M")
    return $q->renewal_per * 30;
    if ($q->renewal_cycle == "Y")
    return $q->renewal_per * 365;
    if ($q->renewal_cycle == "D")
    return $q->renewal_per;
    }
    }
    }

    According to the wordpress documentation, the prepare() method now requires 2 parameters:

    Taken from http://codex.wordpress.org/Class_Reference/wpdb

    Please note: As of 3.5, wpdb::prepare() enforces a minimum of 2 arguments. [more info]
    <?php $sql = $wpdb->prepare( 'query' , value_parameter[, value_parameter ... ] ); ?>
    Screen shot 2013-08-13 at 9.47.56 PM.png
     

Share This Page