0
如何限制插入數據到MySql使用codeiginter? 我有10000個陣列數據。 但是我想在每個過程中只限制200個數據。 下一個過程必須從尚未插入的數據中插入。 下面是從控制器我的代碼:如何限制插入數據到MySql使用codeiginter
<?php
foreach($data["result"] as $key) {
$insert=$this->db->insert('master_mahasiswa_pt',$key);
if (!$insert && $this->db->error()) {
echo "Data nim"; echo " "; echo $key['nipd'] ; echo " "; echo "Sudah Ada"; echo '<br>';
} else {
echo "Data nim"; echo " "; echo $key['nipd'] ; echo " "; echo "Sudah Masuk"; echo '<br>';
}
}
}
}
?>
這裏是從我的陣列數據例如:
Array
(
[error_code] => 0
[error_desc] =>
[result] => Array
(
[0] => Array
(
[id_reg_pd] => 35e86b4f-1b8b-407b-b49e-9d125cba2cb5
[nipd] => 150015020
[id_pd] => b5261e3d-6aed-41e9-a329-1ebe6191d53c
[nm_pd] => ACDB
[tgl_lahir] => 1996-06-16
[id_sms] => 63d9ecdb-4468-4883-a1aa-13ad3f88fce1
[fk__sms] => Teknik Informatika
[id_sp] => 89a93cb2-f959-45d3-8a75-f349be529b87
[fk__sp] => STMIK
[tgl_masuk_sp] => 2015-08-25
[id_jns_daftar] => 1
[fk__jns_daftar] => Peserta didik baru
[id_jns_keluar] =>
[fk__jns_keluar] =>
[tgl_keluar] =>
[ket] =>
[skhun] =>
[a_pernah_paud] => 0
[a_pernah_tk] => 0
[mulai_smt] => 20151
[sks_diakui] => 0
[jalur_skripsi] =>
[judul_skripsi] =>
[bln_awal_bimbingan] =>
[bln_akhir_bimbingan] =>
[sk_yudisium] =>
[tgl_sk_yudisium] =>
[ipk] =>
[no_seri_ijazah] =>
[sert_prof] =>
[a_pindah_mhs_asing] =>
[nm_pt_asal] =>
[nm_prodi_asal] =>
)
)
)