Home › Forums › General Issues › ORDER BY on SELECT not working › Reply To: ORDER BY on SELECT not working
Ok, managed to solve it by swapping the SQl round a little, like so:
$rows = $wpdb->get_results($wpdb->prepare(
"
SELECT *
FROM wp_postmeta
WHERE meta_key LIKE %s AND meta_value LIKE %s ORDER BY meta_value ASC",
'dates_%_available_dates', ''.$year.''.$month.'%',
""
));
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.