prepare() function issues
-
I’ve had this site and the theme is no longer supported, developer decided to stop further work and i’ve been trying to figure out the fix to this and basically forgot about it for like a couple years – judging by the post dates regarding this matter, specifically this one.
so my error is this:
Warning: Missing argument 2 for wpdb::prepare(), called in
wp-content/themes/MnC/lib/engine/nws-admin-functions.php on line 2680 and defined in /wp-includes/wp-db.php on line 1152and this is the chunk of code:
function nws_get_theme_version() {
global $wpdb;$th_vers = NULL;
// the table
$table = is_dbtable_there(‘status’);
// the sql
$th_vers = $wpdb->get_var( $wpdb->prepare( “SELECT th_vers FROM $table WHERE id = 1 LIMIT 0,1” ) );return $th_vers;
}this other link on the other hand, is pretty much the same exact situation and i’d bet money the user was using the same theme… but the fix crashes the whole site (google only gave me another link with a couple of people having the same line of code/error combination but no response/fix)
I’d like to know how that can be fixed, not necessarily looking into changing the whole website, as most posts state, if you’re a user you won’t be affected, and I’m not really keen on turning off warnings.
Thanks for your input and time
Fredo
- The topic ‘prepare() function issues’ is closed to new replies.