PHPがテーブルを作成するために使用している単純なクエリ(mySQLビュー)があります:
select `swtickets`.`ownerstaffid` AS `ID`,
`swtickets`.`ownerstaffname` AS `Owner`,
sum(if((`swtickets`.`ticketstatusid` = 2),1,0)) AS `In Progress`,
sum(if((`swtickets`.`ticketstatusid` = 4),1,0)) AS `Pending Customer`,
sum(if((`swtickets`.`ticketstatusid` = 5),1,0)) AS `Customer Replied`,
sum(if((`swtickets`.`ticketstatusid` = 9),1,0)) AS `Suggested Resolution`,
sum(if((`swtickets`.`priorityid` in (3,6) and `swtickets`.`ticketstatusid` in (2,4,5,9)),1,0)) AS `High/Critical`,
sum(if((`swtickets`.`ticketstatusid` in (2,4,5,9)),1,0)) AS `Total Workable`
from `swtickets` where ((`swtickets`.`departmentid` = 14)
and ownerstaffid in (select staffid from swstaff where staffgroupid=4 and isenabled = 1)
and (`swtickets`.`ownerstaffname` <> '')) group by `swtickets`.`ownerstaffname`
while ループでデータを呼び出していますが、Owner 列のハイパーリンクのターゲットとして機能するため、呼び出す必要がある 'ID' 列を取り除くことができないようです。理想的なヘッダーは次のとおりです。
所有者 | 進行中 | 保留中のお客様 | お客様からの返信 | 推奨される解決方法 | 総実行可能
php:
$ticketloadquery = mysql_query("SELECT * from open_tickets;")
or die(mysql_error());
$ticketloadfield_num = mysql_num_fields($ticketloadquery);
echo "<div><h1>Work Load</h1>";
if(mysql_num_rows($ticketloadquery)==0) {
echo "<i>There are no currently unassigned tickets!</i>";
}
else{
echo "<table border='1'><tr>";
for($i=0; $i<$ticketloadfield_num; $i++)
{
$ticketloadfield = mysql_fetch_field($ticketloadquery);
echo "<td>{$ticketloadfield->name}</td>";
}
echo "</tr>\n";
while($ticketloadinfo = mysql_fetch_array( $ticketloadquery ))
{
echo "<tr>";
echo "<td><a href='https://support.mysite.com/staff/dashboard.php? id=".$ticketloadinfo['ID']."', target='_blank'>".$ticketloadinfo['Owner']."</a></td> ";
echo "<td>".$ticketloadinfo['Owner'] . "</td> ";
echo "<td>".$ticketloadinfo['In Progress'] . "</td> ";
echo "<td>".$ticketloadinfo['Pending Customer'] . " </td>";
echo "<td>".$ticketloadinfo['Customer Replied'] . " </td>";
echo "<td>".$ticketloadinfo['Suggested Resolution'] . " </td>";
echo "<td>".$ticketloadinfo['Total Workable'] . " </td></tr>";
}
echo "</div>";
echo "</table>";
}
助言がありますか?