Hi.. I currently have these queries.
Now that actually runs 11 queries, because the first says get only 10 results, then each one of those results gets a query.
I know of a way to combine the queries, but then I would not be able to control the LIMIT. Is there a way to-do this?
Code:
$q = $_db->Query('SELECT id,DATE_FORMAT(start, \'%M %d, %Y\') as start,DATE_FORMAT(end, \'%M %d, %Y\') as end FROM refContest ORDER BY id DESC LIMIT 10');
while($r = $_db->Fetch($q))
{
$q = $_db->Query('SELECT w.*,m.username FROM refContestWinners w LEFT JOIN members m ON w.winner=m.id ORDER BY w.place');
while($winner = $_db->Fetch($q))
{
}
}
Now that actually runs 11 queries, because the first says get only 10 results, then each one of those results gets a query.
I know of a way to combine the queries, but then I would not be able to control the LIMIT. Is there a way to-do this?