例如,在我的 sql 查询下面。
$query = mysql_query("SELECT COUNT(*) as `box.id`
from boxes as box
left join page_boxes as pbox
on box.id=pbox.bid
left join page_subcribers as pages
on pages.page_id=pbox.page_id
left join category_boxes as cbox
on box.id=cbox.bid
left join subcribers as catsb
on cbox.category_id=catsb.cid
where pages.uid='".$session_id."' or catsb.uid='".$session_id."'
and box.status='".$approval."'")or die (mysql_error());
$row = mysql_fetch_array($query);
$total = $row['id'];
我需要box.id
作为该查询的索引$total = $row['id'];
,但是当我像这样使用它$total = $row['id'];
时出现错误
Notice: Undefined index: id in C:\xampp\htdocs\media\ctrx.php on line 12
我怎样才能得到这个索引 id 值?