我想将此格式更改为codeigniter格式,即
this->db->where('','')
这是我的代码
$data = "UPDATE dbhpl.hplpb SET hplpb.PEL_4 = (select COUNT(*) FROM pelayanan
WHERE pelayanan.ID_AREA=hplpb.ID_AREA AND pelayanan.ID_VERIFIKASI='4'
AND pelayanan.TRANSAKSI='PENYAMBUNGAN BARU' AND pelayanan.ESTIMASI='4'
AND pelayanan.ID_STATUS='1')";
$this->db->query($data);
我怎样才能改变它?
你可能想试试这个
$data = array(
'ID_VERIFIKASI' => '4',
'TRANSAKSI' => 'PENYAMBUNGAN BARU',
'ESTIMASI' => '4',
'ID_STATUS' => '1'
);
$this->db->where($data)
->from('pelayanan')
->join('hplpb', 'hplpb.ID_AREA = pelayanan.ID_AREA', 'inner');
$count = $this->db->count_all_results();
$data = array(
"PEL_4" => $count
);
$this->db->update('hplpb', $data);