over 9 years ago
Hello reader's If you are using codeigniter and want to make '<=' mysql query then you can use the code syntax as below:-
- ->select('COUNT(payment.keyid) AS rec_count')
- ->where('payment.paymentdate >=', $month_start)
- ->where('payment.paymentdate <=', $month_end)
- ->get()
->select('COUNT(payment.keyid) AS rec_count') ->where('payment.paymentdate >=', $month_start) ->where('payment.paymentdate <=', $month_end) ->get()
here you just have to add the line
And similarly you can make joins or ordery by clauses also as example below:-
- ->select('product_key.client_name, product_key.contact_email, product_key.status, product_key.id, payment.paymentdate, (payment.id) as pid,payment.subscription_type')
- ->from('product_key')
- ->join('payment', 'payment.keyid=product_key.id', 'left outer')
- ->where('status', 'purchased')
- ->order_by('client_name', "asc")
- ->group_by('product_key.id')
->select('product_key.client_name, product_key.contact_email, product_key.status, product_key.id, payment.paymentdate, (payment.id) as pid,payment.subscription_type') ->from('product_key') ->join('payment', 'payment.keyid=product_key.id', 'left outer') ->where('status', 'purchased') ->order_by('client_name', "asc") ->group_by('product_key.id')
0 Comment(s)