• Resolved boldizark

    (@boldizark)


    I have an old theme that is not supported by the developer anymore, https://www.rancesoaps.com.

    I’m getting this error when I switched to a hosting company. Im not sure how to fix this.

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/angelswingsgiftj/public_html/rancesoaps.com/wp-content/themes/TheJewelryShop/lib/engine/nws-admin-functions.php on line 2430 and defined in /home/angelswingsgiftj/public_html/rancesoaps.com/wp-includes/wp-db.php on line 1197

    Code:
    nws-admin-functions.php on line 2430

    $th_vers = $wpdb->get_var( $wpdb->prepare( "SELECT th_vers FROM $table WHERE id = 1 LIMIT 0,1" ) );
    
    	return $th_vers;
    }

    wp-db.php on line 1197

    public function prepare( $query, $args ) {
    		if ( is_null( $query ) )
    			return;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The error is in the themes file, not the WordPress core file. ??

    As the error says, a call to $wpdb->prepare() needs a minimum of two parameters, and that script only gives one. It should be more like this:

    $th_vers = $wpdb->get_var( "SELECT th_vers FROM $table WHERE id = 1 LIMIT 0,1" );

    Thread Starter boldizark

    (@boldizark)

    I have no idea what that means but it worked like a charm! ?? Thanks so much!!! You are really very awesome, well deserved title.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Warning in WordPress file’ is closed to new replies.