作者:川崎步 | 来源:互联网 | 2023-05-17 08:21
IhaveaPHPWhileloop:我有一个PHPWhile循环:$workgroupsmysqli_query($con,SELECTa.TASK_ID,a.DELE
I have a PHP While loop:
我有一个PHP While循环:
$workgroups = mysqli_query($con,"SELECT a.TASK_ID, a.DELETE_WEEK, SUM(a.MON_BILL+a.TUE_BILL+a.WED_BILL+a.THU_BILL+a.FRI_BILL) AS hours, b.ID, b.TITLE, b.GROUP_ID, c.ID, c.NAME, d.VALUE_ID, reverse(reverse(d.VALUE) + 0) AS companyid, e.VALUE_ID, e.UF_CRM_1384938829 AS hourrate, f.ID, f.TITLE as companyname FROM b_report_week a INNER JOIN b_tasks b ON a.TASK_ID = b.ID INNER JOIN b_sonet_group c ON b.GROUP_ID = c.ID INNER JOIN b_utm_tasks_task d ON a.TASK_ID = d.VALUE_ID INNER JOIN b_uts_crm_company e ON reverse(reverse(d.VALUE) + 0) = e.VALUE_ID INNER JOIN b_crm_company f ON reverse(reverse(d.VALUE) + 0) = f.ID WHERE a.DELETE_WEEK = 0 GROUP BY a.TASK_ID");
while($row = mysqli_fetch_array($workgroups))
{
$taskTitle = $row['TITLE'];
$taskTotalHours = $row['hours'];
$companyName = $row['companyname'];
$companyRate = number_format($row['hourrate'] / 7.50,2);
$valueTotal = number_format($row['hours'] * number_format($row['hourrate'] / 7.50,2),2);
}
This produces the correct results in a table if I were to draw a table inside the loop (Displays about 8 rows with the 5 columns identified above). What I am wanting is to display the $companyname down the Y axis and the $valueTotal across the x axis. I rather new to Google graphs but I've tried the following (to no joy):
如果我要在循环内绘制一个表,则会在表中生成正确的结果(显示大约8行,上面标识了5列)。我想要的是在Y轴上显示$ companyname,在x轴上显示$ valueTotal。我更喜欢Google图表,但我尝试过以下内容(不要高兴):
3 个解决方案