WordPress.org

Forums

Sponsors Carousel
Warning Missing Argument (4 posts)

  1. oogly
    Member
    Posted 2 years ago #

    Getting this warning message when using the plugin:

    Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/sponsors-carousel/sponsors-carousel.php on line 239 and defined in /wp-includes/wp-db.php on line 990

    Have fixed the media_buttons issue for image uploader, but not sure what to do on this one.

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/sponsors-carousel/

  2. baalam
    Member
    Posted 2 years ago #

    Same situation... somebody help!

    The faulty code is here, but how to fix it?

    $thepost = $wpdb->get_row( $wpdb->prepare( "SELECT *
    			FROM $wpdb->posts WHERE guid = '".$scwp_link_image."'" ) );
    			if (isset($thepost->ID))
    			{
    				$scwp_list = get_option('scwp_list');
    				if ($scwp_list>"") $scwp_list.=" ";
    				$scwp_list .= $thepost->ID;
    				update_option("scwp_list", $scwp_list);
    			}
  3. ppasieka
    Member
    Posted 2 years ago #

    Fix that work for me:
    You need to change $wpdb->prepare(...)
    before:

    $thepost = $wpdb->get_row( $wpdb->prepare( "SELECT *
    			FROM $wpdb->posts WHERE guid = '".$scwp_link_image."'" ) );

    after:

    $thepost = $wpdb->get_row( $wpdb->prepare( "SELECT *
    			FROM $wpdb->posts WHERE guid = '%s'", $scwp_link_image ) );
  4. baalam
    Member
    Posted 2 years ago #

    It worked!

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Sponsors Carousel
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic