Title: Warning in WordPress file
Last modified: August 30, 2016

---

# Warning in WordPress file

 *  Resolved [boldizark](https://wordpress.org/support/users/boldizark/)
 * (@boldizark)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/warning-in-wordpress-file/)
 * I have an old theme that is not supported by the developer anymore, [http://www.rancesoaps.com](http://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)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/warning-in-wordpress-file/#post-6668514)
 * 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](https://wordpress.org/support/users/boldizark/)
 * (@boldizark)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/warning-in-wordpress-file/#post-6668534)
 * 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.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)
 * [wordpress warning](https://wordpress.org/support/topic-tag/wordpress-warning/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [boldizark](https://wordpress.org/support/users/boldizark/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/warning-in-wordpress-file/#post-6668534)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
