• I’m getting warning in my site

    http://martinihouse.ca/catering/
    Warning: Missing argument 2 for wpdb::prepare(), called in /home/barry/public_html/wp-content/themes/bordeaux/footer.php on line 23 and defined in /home/barry/public_html/wp-includes/wp-db.php on line 992
    Warning: Missing argument 2 for wpdb::prepare(), called in /home/barry/public_html/wp-content/themes/bordeaux/functions/bordeaux_menu.php on line 5 and defined in /home/barry/public_html/wp-includes/wp-db.php on line 992

    I checked on my theme code
    For footer:
    $google_loc = $wpdb->get_var($wpdb->prepare(“SELECT post_content FROM $wpdb->posts WHERE post_type = ‘boderaux_google_loc'”));

    for bordeaux_menu.php

    $count = $wpdb->get_var($wpdb->prepare(“SELECT COUNT(id) as Num FROM bordeaux_reservation WHERE approve=””));

    how can i fix this problem

Viewing 2 replies - 1 through 2 (of 2 total)
  • Are you using the most current version of your theme?

    http://themeforest.net/item/bordeaux-premium-restaurant-theme/339458

    See this re: that error:

    PHP Warning: Missing argument 2 for wpdb::prepare()

    Help me please;

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/fornode/public_html/wp-content/themes/alim_v2/functions/bordeaux_menu.php on line 5 and defined in /home/fornode/public_html/wp-includes/wp-db.php on line 1147

    bordeaux_menu.php line 5

    $count = $wpdb->get_var($wpdb->prepare(“SELECT COUNT(id) as Num FROM bordeaux_reservation WHERE approve=””));

    wp-db.php line 1147

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

    // This is not meant to be foolproof — but it will catch obviously incorrect usage.
    if ( strpos( $query, ‘%’ ) === false ) {
    _doing_it_wrong( ‘wpdb::prepare’, sprintf( __( ‘The query argument of %s must have a placeholder.’ ), ‘wpdb::prepare()’ ), ‘3.9’ );
    }

    $args = func_get_args();
    array_shift( $args );
    // If args were passed as an array (as in vsprintf), move them up
    if ( isset( $args[0] ) && is_array($args[0]) )
    $args = $args[0];
    $query = str_replace( “‘%s'”, ‘%s’, $query ); // in case someone mistakenly already singlequoted it
    $query = str_replace( ‘”%s”‘, ‘%s’, $query ); // doublequote unquoting
    $query = preg_replace( ‘|(?<!%)%f|’ , ‘%F’, $query ); // Force floats to be locale unaware
    $query = preg_replace( ‘|(?<!%)%s|’, “‘%s'”, $query ); // quote the strings, avoiding escaped strings like %%s
    array_walk( $args, array( $this, ‘escape_by_ref’ ) );
    return @vsprintf( $query, $args );
    }
    what’s wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing argument 2 for wpdb::prepare() in bordeaux_menu.php’ is closed to new replies.