Error: select tbl_order.id as oi,deal_id,order_date,tbl_coupon.id from tbl_order left join tbl_coupon
on tbl_order.id = tbl_coupon.order_id where tbl_order.status='paid' and tbl_order.user_id= order by payment_date desc
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order by payment_date desc' at line 3