php - Convert Mysql query to Codeigniter -
i need bit of help... trying convert mysql query codeigniter, not working...
mysql:
select users.email, transactions.id, transactions.type, transactions.status, transactions.sum, transactions.created, transactions.title transactions, users users.id=transactions.user_id , transactions.type='winning_claim' , date(transactions.created)=date(subdate(now(),1))
codeigniter: `
$this->db->select('users.email, transactions.id, transactions.type, transactions.status ,transactions.sum, transactions.created, transactions.title'); $this->db->from('transactions'); $this->db->join('users', 'users.id = transactions.user_id'); $this->db->where('transactions.type', 'winning_claim'); $this->db->where('date(transactions.created)', 'date(subdate(now(), 1))'/*, false */); $select_la_data = $this->db->get();`
does have thoughts?
Comments
Post a Comment