首頁 > 後端開發 > php教程 > 查詢資料庫後數組統計次數,並達到如圖效果?

查詢資料庫後數組統計次數,並達到如圖效果?

WBOY
發布: 2016-08-08 09:06:54
原創
937 人瀏覽過

service_channel為投訴管道,投訴次數(c),投訴人數的應該為(count(t) 相同的次數和) 有多個投訴渠道怎麼實現下面這張圖的效果? 明細忽略.. 謝謝^_^
0 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

1 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

2 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

3 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

4 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

5 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

6 =>
13 =>

<code>array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

14 =>

<code>array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

15 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

16 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

17 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

18 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

19 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

20 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)
</code>
登入後複製
登入後複製

查詢資料庫後數組統計次數,並達到如圖效果?

回覆內容:

service_channel為投訴管道,投訴次數(c),投訴人數的應該為(count(t) 相同的次數和) 有多個投訴渠道怎麼實現下面這張圖的效果? 明細忽略.. 謝謝^_^
0 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

1 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

2 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

3 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

4 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

5 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

6 =>
13 =>

<code>array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

14 =>

<code>array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

15 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

16 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

17 =>

<code>array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

18 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

19 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)</code>
登入後複製
登入後複製
登入後複製
登入後複製

20 =>

<code>array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)
</code>
登入後複製
登入後複製

查詢資料庫後數組統計次數,並達到如圖效果?

<code>select create_time,service_channel,c,count(*) as '人数' from a group by create_time,service_channel,c</code>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板