I need to make a query with php and mysql, the idea is to consult all the data of 2 columns, especially the table, user_id and validity_document.
I want to check all the data to see if a document is expired and if so send an email alerting, I appreciate if you can help me or suggest ideas for the query.
mysql> SELECT id_usuario, vigencia_documento FROM usuario
-id_conductorPrimaria int(11)
-nombre_conductorÍndice char(30) utf8_general_ci
-cc_conductor int(11)
-licencia_conductor int(11)
-vigencia_conductor date
-telefono_conductor char(30) utf8_general_ci
-email_conductor varchar(64) utf8_general_ci
-direccion_conductor varchar(255) utf8_general_ci
-foto_conductor varchar(255) latin1_swedish_ci
-status_conductor tinyint(4)
-date_added datetime
The data that I need to evaluate is: -conduct_vigencia identify the driver to send an email