The system is for phone contract comparison. Originally we could filter the result by length, given in months. However we've opted to storing this as a timestamp of the end date of contract in the database.
The original PHP was as follows:
$min = min($_POST["length"])-6;
$max = max($_POST["length"]);
$query[] = "length BETWEEN $min AND $max";
In summary, here's what we have at the moment:
In the database is stored the end-date of the contract (as a timestamp)
The post value contains how many months from now it should last (eg. 7-12 months would have a value of 7)
How can we change the PHP calculations to get the between values from the database?
Many thanks, Nick.