Dear All experts,
Hi, me again!
This time I have a Time comparison problem would like to ask all you advice.
In my MySQL table (e.g. product), the date of the data is one of the field of the table "product". It is stored in timestamp, i.e. the "date" of data A will be 2002-04-02 13:23:04.
Original query:
$result = = mysql_query("SELECT * From product");
Now, I would like to query my mysql to show all data whose time difference comparing with this moment is only less than 7 days.
I have a variable $current = date("Y-m-d H:i:s");
I hope my new query as something like that
$result = mysql_query("SELECT * From product WHERE ($current - date) <= 7 days");
Any comment and solution?