Home › Forums › General Issues › Looking for a SQL Query to get posts and AC fields › Reply To: Looking for a SQL Query to get posts and AC fields
There isn’t a query that you can run that will select posts and return all meta values associated with it. This requires multiple queries. First the one you have above. Then you need to loop over that return and do a query like:
// please note that this may not be the best way to do this query,
// I am not an SQL expert.
"SELECT * FROM postmeta WHERE post_id = '{$post_id}'
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.