Using timestampdiff with query builder codeigniter
Solution:
$this->db->select("payment_date, download_date, TIMESTAMPDIFF(DAY, payment_date, download_date)",FALSE); $query = $this->db->get('transaksi'); return $query->result();
Sub Query not necessary there.
$this->db->select("payment_date, download_date, TIMESTAMPDIFF(DAY, payment_date, download_date)",FALSE);$query = $this->db->get('transaksi');return $query->result();