我有下表:
在查询中,我使用 group_concat 获取错误 ID。我想为每个错误 ID 提供单独的链接。例如:要给出的链接是“show_bug.cgi?id =3743200”
以下是我使用过的代码:
$query = "select count(cbm.bug_id) as count,(select concat(round((count(cbm.bug_id)/(select count(*) from techzilla.category_bug_map cbm,techzilla.bugs b where b.assigned_to =$userId and cbm.bug_id=b.bug_id) * 100 ),2),'%')) as Percentage ,group_concat(b.bug_id separator ',') as BugIds from techzilla.bugs b left join techzilla.category_bug_map cbm on cbm.bug_id = b.bug_id where b.assigned_to = $userId and b.creation_ts >= '$fromDate 00:00:00' and b.creation_ts <= '$toDate 00:00:00' and cbm.os IN ('$opess')";
$result = mysql_query($query) or die ("Bad query: " . mysql_error() );
while($row = mysql_fetch_row($result)) {
echo "<tr><td>$opess</td>
<td>$row[0]</td>
<td>$row[1]</td>
<td>$row[2]</td></tr>";
}
我怎样才能做到这一点?