title: SQL Syntax Error after updating to WordPress 4.8.2
body: <p>I have been using a hook in the Advanced Custom Fields plugin (load_field) which loads objects from a table in my database to an ACF select field. The table ('wp_new_royalsliders') is created by the RoyalSlider image slider plugin so i use the hook to populate a select field with the slider names.</p>
  
  <p>This function has worked fine for a long time but recently stopped working - I think after updating core to 4.8.2:</p>
  
  <pre><code>    add_filter('acf/load_field/name=media_gallery_slider', 'my_acf_royalslider_choices');
  
      function my_acf_royalslider_choices($field){
  
        $field['choices'] = array();
  
        global $wpdb;
  
        $query = $wpdb-&gt;prepare('SELECT * FROM %1$s ORDER BY ID ASC', 'wp_new_royalsliders');
        $results = $wpdb-&gt;get_results($query);
  
        if(!empty($results)) :
  
        foreach($results as $result) :
  
            $value = $result-&gt;id;
            $label = $result-&gt;name;
  
            $field['choices'][ $value ] = $label;
  
        endforeach;
        endif;
        return $field;
  
      }
  </code></pre>
  
  <p>When I turn debugging on I get an error:</p>
  
  <p>WordPress database error: <code>[You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%1$s ORDER BY ID ASC' at line 1]
  SELECT * FROM %1$s ORDER BY ID ASC</code></p>