I am working on a wordpress platform, while generating a mysql query I want to display the number of rows from that query. An example is shown below.
$query = ("SELECT wp_posts.ID, wp_term_relationships.object_id
FROM wp_posts
LEFT JOIN wp_term_relationships ON wp_posts.ID = wp_term_relationships.object_id
WHERE post_date <= '$now'
AND term_taxonomy_id = '$catid'
AND post_date >= '$then'
AND post_status = 'publish'");
Now when I generate this query into phpmyadmin, it gives the following output
Showing rows 0 – 5 (6 total, Query took 0.0013 sec)
I want to display the number of rows i-e 6 total …
so what function i must use to display it ??
1 Answer