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
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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.