I have an invoice which will be filled in monthly, the records with the date do it correctly at Hora de Caracas/Venezuela
, but in the following script it shows the values of example 05/agosto/17 al 05/septiembre/2017
, which would clash with an invoice which has been made the previous month, that is, only shows the current month in this case September, if October shows only the records that were made in October and so on.
$sql = "SELECT * FROM gasto_g WHERE 'create_at' BETWEEN DATE_SUB( NOW( ) , INTERVAL 1 MONTH ) AND NOW( ) + INTERVAL 4 HOUR ";
I read about curdate and it works. I take today's date, but if a record was made yesterday it does not show it, I do not know if I did it wrong.
This is the structure of the table: