I am trying to calculate the numbe rof days between today's date and a future date, for end dates on evaluation software.
Here is my code;
Code: Select all
// Database query
$sql = mysql_query("SELECT * FROM software WHERE trial = 'YES'");
$row = mysql_fetch_array($sql);
// Set variable $today to today's date
$today = date("Y-m-d"); // Set today's date as variable
//set date two variable to the field value of end_date from the query
$datetwo = $row['end_date'];
// Set variable for number of evaluation days left
$daysleft = ((strtotime($datetwo) - strtotime($today))/86400);Please help