So, you all suggest me to go with one query gathering all the info I want, and some while statements to further process specific parts of the info.
But let me ask you something here. How, for example, would I gather the latest 5 thread titles from each one of 20 forums, using just one query ?
Supposing that the following query can be used to select the last 5 threads from a single forum....
Code:
$DB_site->query("SELECT threadid,title FROM thread
WHERE forumid = $forumid
ORDER BY lastpost DESC limit 5")
..how could we achieve to additionally:
1) have it selecting the last 5 threads from the first forum of $myforums[mylist], after that from the second one, the third... until all forums have been used. At the end I would have selected 5*20=1000 threads, the latest 5 from each of my 20 forums in the list.
2) have it selecting not only from the parsed forum in the list, but also from all its subforums (not stated in the list).
Are these possible with a single query, or I would end up using 20, one query for each forum ??
many thanks