Copy link to clipboard
Copied
A client wants me to make a site which stores venue events in a database and seperates them between ones which are in the future or less than a month old and ones which are more than a month old
my first thoughts are this PHP function
http://php.net/manual/en/function.date.php
my PHP script will set a varable at ether todays date or todays date minus 30 days and perfrom a mysql query for all dates ether after of before that date
i guessing that i will need to format the date entirely numerically so that i can use
IF (date =< todays date) {
are operrators such as < the correct way to proceed?
Copy link to clipboard
Copied
iconofsin14 wrote:
are operrators such as < the correct way to proceed?
Yes, but the correct "lower than or equal" operator would be <=.
BTW, here´s what the MySQL documentation says: "When you compare a DATE, TIME, DATETIME, or TIMESTAMP to a constant string with the <, <=, =, >=, >, or BETWEEN operators, MySQL normally converts the string to an internal long integer for faster comparison"
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more