Support » Plugin: Sponsors Carousel » Warning Missing Argument

  • 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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);
    			}

    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 ) );

    It worked!

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning Missing Argument’ is closed to new replies.