Support

Account

Home Forums Add-ons Repeater Field Repeater Plugin – Group By Help Reply To: Repeater Plugin – Group By Help

  • I had similar.

    If you look at the below:

    $rows = $wpdb->get_results($wpdb->prepare( 
    "
    SELECT * 
    FROM wp_postmeta
    WHERE meta_key LIKE %s AND meta_value LIKE %s GROUP BY meta_value ASC",
    'dates_%_available_dates', ''.$year.''.$month.'%', 			
    ""		
    ));	

    You can see that dates_%_available_dates is the repeater field as it went:
    dates_0_available_dates
    dates_1_available_dates
    dates_2_available_dates
    etc

    Using the % allows you to be more dynamic, as you can search on all with the LIKE statement

    This is the link I used:

    It may help you with your code. I most certainly think rewriting your query to something like my example or the one in the link will help though