hello, i have a problem, i not professional about database, i have develop a website from php then i stuck on database. already 3 days stuck from it. now i need a help.

i have 3 table.
status 1=active
status 0= deactive

table name: users
idnamestatuslicense
1john1
2crown1mui_K56U-PLBU-2R39-D62I


table users(license) only link with table service_license(license_key)


table name: service_license
idclient_idlicense_key
51mui_K56U-PLBU-2R39-D62I
61mui_Y4J5-51D6-8XCD-UFY9




table client_order (table client_order(client_id) on link with table_service(client_id))

idclient_idproduct_idservice_typestatusexpires_at
517licenseactive2014-11-11T00:49:04+08:00
617licenseactive2016-11-11T00:49:04+08:00




my request is: if any license has been expired, the status from table users will change to zero.
Edit · Delete