有人知道如何使用数据记录
实现我的SQL代码SELECT *
FROM `jadwal`
WHERE YEAR(tgl) = YEAR(NOW())
AND MONTH(tgl) = MONTH(NOW())
AND DAY(tgl) = DAY(NOW())
提前致谢
答案 0 :(得分:0)
您可以按照以下方式进行操作 -
$where = array('YEAR(tgl)' => YEAR(NOW()),
'MONTH(tgl)' => MONTH(NOW()),
'DAY(tgl)' => DAY(NOW())
);
$this->db->select('*');
$this->db->where($where);
$query = $this->db->get('jadwal');
$res1 = $query->result(); // as object
$res2 = $query->result_array(); // as array
试着让我知道。