我已經在數據庫中執行,從表中的數據,結果是刪除重複數據陣列鍵和assoc命令
array(3) {
[0]=>
array(5) {
[0]=> string(1) "1"
["id_pegawai"]=> string(1) "1"
[1]=> string(1) "1"
["id_jabatan"]=> string(1) "1"
[2]=> string(1) "1"
["id_media"]=> string(1) "1"
[3]=> string(7) "Marjana"
["nama_pegawai"]=> string(7) "Marjana"
[4]=> string(8) "NIK.0001"
["nik"]=> string(8) "NIK.0001"
},
[1]=>
array(5) {
[0]=> string(1) "2"
["id_pegawai"]=> string(1) "2"
[1]=> string(1) "4"
["id_jabatan"]=> string(1) "4"
[2]=> string(1) "8"
["id_media"]=> string(1) "8"
[3]=> string(7) "Deny"
["nama_pegawai"]=> string(7) "Deny"
[4]=> string(8) "NIK.0007"
["nik"]=> string(8) "NIK.0007"
},
[2]=>
array(5) {
[0]=> string(1) "3"
["id_pegawai"]=> string(1) "3"
[1]=> string(1) "9"
["id_jabatan"]=> string(1) "9"
[2]=> string(1) "6"
["id_media"]=> string(1) "6"
[3]=> string(7) "Juny"
["nama_pegawai"]=> string(7) "Juny"
[4]=> string(8) "NIK.0011"
["nik"]=> string(8) "NIK.0011"
}
}
我想改變這樣的:
array(3) {
[0]=>
array(5) {
[0]=> string(1) "1"
[1]=> string(1) "1"
[2]=> string(1) "1"
[3]=> string(7) "Marjana"
[4]=> string(8) "NIK.0001"
},
[1]=>
array(5) {
[0]=> string(1) "2"
[1]=> string(1) "4"
[2]=> string(1) "8"
[3]=> string(7) "Deny"
[4]=> string(8) "NIK.0007"
},
[2]=>
array(5) {
[0]=> string(1) "3"
[1]=> string(1) "9"
[2]=> string(1) "6"
[3]=> string(7) "Juny"
[4]=> string(8) "NIK.0011"
}
}
如何刪除陣列與聯合? 請幫助我,謝謝
注意:我不使用MYSQL,但ORACLE。 ,我執行的查詢使用這樣的代碼:
$this->connection->executeQuery($sql, array($tanggalAwal, $tanggalAkhir), array(Type::DATETIME, Type::DATETIME))->fetchAll();
[你嘗試過什麼到目前爲止(http://mattgemmell.com/2008/12/08/what-have-you-tried/),你在哪裏卡住? – Bjoern 2013-04-25 08:57:03
當你從db中提取數據的時候,只需要從db中獲取索引數組。看來你正在使用一些mvc框架 – Poonam 2013-04-25 08:59:23