Check current date automatically

2

I'm developing a system with PHP where: I've made available a contest entry page for staff, but this page has an end time, example: The page will be available from today 05/08/18: 17:11 and will disappear on 09/05/18 23:59:00. I know I can capture the current date and time in mysql using the following select: SELECT DATE_FORMAT(NOW(), '%d/%m/%Y %H:%i:%s'); . I need to somehow compare this date with the date specified at the end of the contest and on arriving at the specified time, do not display the same.

I did not post code because I really could not develop anything, I need a light how to proceed. I'm developing the system in PHP pure, without framework. Can anyone help me?

    
asked by anonymous 08.05.2018 / 22:16

1 answer

4

Make a condition in WHERE of query :

SELECT
  *
FROM [table]
WHERE [campo_data_expiracao] < NOW()

Something like that. Anything post your table structure so that I can be more specific in the response.

    
08.05.2018 / 22:23