在一個數據庫中,我有一個表tca
和status
列。這可能是new, process, completed
等
當我查詢此表SELECT status, count(*) FROM tca GROUP BY status
找出有一定地位的計數我得到follwing多維數組回mySQL count(*)數組的含義
Array ( [0] => Array ( [status] => new [0] => new [count(*)] => 6 [1] => 6 ) [1] => Array ( [status] => process [0] => process [count(*)] => 1 [1] => 1 ) [2] => Array ( [status] => completed [0] => completed [count(*)] => 1 [1] => 1 ) )
爲什麼有冗餘子陣列[status]
,[0]
和[count(*)]
,[1]
?
這不是一個SQL問題,它是如何將結果集返回給客戶端的...... – dnoeth
使用'mysqli_fetch_assoc()'。可能會給陣列沒有冗餘列。 –
@dnoeth - 你是SQL的廚師 - 謝謝 – Ben