Support

Account

Home Forums Add-ons Repeater Field Old values returned when querying ACF Repeater rows with $wpdb->prepare

Helping

Old values returned when querying ACF Repeater rows with $wpdb->prepare

  • When querying the database directly for several ACF repeater fields, I have found that old field values are being returned in the results. For example, if one of my repeater fields (named caption) is set as ‘Lorem Ipsum’, and I save a new value in that field replacing it with ‘Dolor Sit’, both ‘Lorem Ipsum’ and ‘Dolor Sit’ are returned in my $wpdb object. Is this behavior to be expected based off the query I’m using? Is it possible to only get the most recently updated value, or otherwise omit these old field values?

    I’m using the following query:

    global $wpdb;
      $rows = $wpdb->get_results($wpdb->prepare( 
          "
          SELECT *
          FROM wp_postmeta
          WHERE meta_key LIKE %s
            OR meta_key LIKE %s
            OR meta_key LIKE %s
            AND meta_value <>''
          ",
          'images_%_tags', // meta_name: $ParentName_$RowNumber_$ChildName
          'images_%_caption',
          'image_set_caption'
      ));
  • <p>Despite ポールスミスバッグアウトレット its obvious link to Thirties era wartime motorcycles from BMW, the 2009 Ural T sidecar motorcycle can’t really be described as "retro." CHICAGO, April 25, 2014 /PRNewswire iReach/ There is ポール スミス 財布 メンズ a lot of excitement in the country surrounding the all new 2015 Porsche Macan crossover SUV since it was announced from the German automaker just a few short months ago."Nothing ポールスミスバッグ could have prepared me for the things that I witnessed. As I became more aware of the state of health care, I realized these experiences weren’t just happening ポール スミス 財布 to me and my loved ones it seemed everyone I met in the hallways and rooms of Eastern Health facilities, wherever I went, had a horror story to tell. http://www.anakinssong.com/paul/</p&gt;

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.