remove display item php

3

I have a problem here, I know it can be simple, but I have not solved it yet.

I have a slide running in a loop of PHP, in this slide there are "entities" that when the expiration day arrives they should be removed from slides , only the slides , ie they would not be displayed anymore.

I have tried unset() but it removes all the products, since everyone has to come from the same query .

    
asked by anonymous 21.10.2015 / 16:37

1 answer

7

As you do not give much detail in your question I will try to guess.

On a slide you have products that can only be on this slide until dd / mm / yyyy, right?

Make this selection soon in mysql:

SELECT * FROM produtos WHERE data_ativa > CURDATE();

So you only select products that are active until TODAY - curdate () - Tomorrow will no longer be on the slide.

If my answer does not help with anything, please detail your question further.

    
21.10.2015 / 16:44