$sql = $empire -> query("select * from issue
where disabled='0' order by issue desc");
while($r=$empire->fetch($sql)){
//get total
$total = $empire -> gettotal("select count(*) as
total from sendbook where issueid='".$r["issue"]."'");
$list .= 'id: '.$r['id'].' issue :'.$r['issue'].' total:'.$total.'';
}
echo $list;
id:1 issue: 23 total:10
id:6 issue: 24 total:0
id:7 issue: 24 total:15
how to use 1 query to finish this work?
Think you!