php - How can I show data which is greater than or equal to mysql table column month? -


i have 2 columns (there more) in clients table.

conn_date     bill_date ======================= 2016-08-25    2016-09-04 2016-08-01    2016-09-03 2016-08-08    2016-09-01 2016-08-09    2016-09-01 

now want show data if selected month = (equal) or > greater conn_date. can selected month html select tag e. g. : 1, 2, 9.

for purpose, using following query it's showing data less conn_date

"select cbp.advance_amount, cbp.bill_month, cbp.due_amount, cbp.pay_amount, c.is_active, c.client_id, c.user_id, c.address, c.contact_no, zone.zone_name, package.package_name, c.monthly_bill, c.bill_date clients  c left join zone on zone.zone_id = c.zone_id  left join package on package.package_id = c.package_id  left join clients_pay_bill cbp on cbp.client_id = c.client_id  c.uid = '$uid' , c.is_active = 1  , month(c.conn_date) > $selected_month  

using print_r

select cbp.advance_amount, cbp.bill_month, cbp.due_amount, cbp.pay_amount, c.is_active, c.client_id, c.user_id, c.address, c.contact_no, zone.zone_name, package.package_name, c.monthly_bill, c.bill_date  clients c  left join zone on zone.zone_id = c.zone_id  left join package on package.package_id = c.package_id  left join clients_pay_bill cbp on cbp.client_id = c.client_id  c.uid = '6' , c.is_active = 1  , month(c.conn_date) > 4 , c.zone_id != ''  order c.client_id desc  

selected month image

enter image description here

basically, want show data not less conn_date of selected month

the mysql query is

select * clients month(conn_date)<='".$selected_month."'  

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -