is there a more efficient way of doing the following?
$total_a = mysql_query("SELECT `id` FROM `table` WHERE `this` = 'that'");
$total_b = mysql_num_rows($total_a);
if(!$total_b)
{
echo 'no results';
}
else
{
$a = mysql_query("SELECT `id`, `time` FROM `table` WHERE `this` = 'that' ORDER BY `time` DESC");
while($b = mysql_fetch_assoc($a))
{
echo $b['id'].'-'.$b['time'].'<br />';
}
}
there is no other way around than using two queries for this, is there?