Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
738 views
in Q2A Core by

Hi

I am currently using the following query to display Questions in a separate Wordpress instance.

                $result = mysql_query("SELECT * FROM qa_posts where type='Q' ORDER BY postid DESC LIMIT 0, 20")
                or die(mysql_error()); 

Is it possible to ONLY select questions where there is an answer has been provided?

Many thanks in advance.

Q2A version: Latest

1 Answer

+4 votes
by

The qa_posts table has an "acount" field that's updated when answers are added/removed. So you can run a query such as

SELECT * FROM qa_posts where type='Q' AND acount>0 ORDER BY postid DESC LIMIT 0, 20
by
Thanks Scott.  This is just what I needed.
...