Hi, I need a little help please with my php. Basically what i'm trying to do is find out the difference between a future date/time and the current date/time. I have the following printing out on screen at the moment:
Two columns -
1. The first one is called "Tomorrow Time" which is basically a timestamp + 24hours. This shows the time + 24 from when the data entered the database.
- The second one is called "Current Time" and this obviously shows the current date/time as per the system.
Here is the code that is printing out the two columns on screen:
<?php
$con = mysql_connect("xxx","xxx","xxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxx", $con);
$result = mysql_query("SELECT tomorrowtime, SYSDATE() FROM proposal");
echo "<table id='myTable' cellpadding='0'>
<thead>
<th axis='string'>Tomorrow Time</th>
<th axis='string'>Current Time</th>
</thead>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['tomorrowtime'] . "</td>";
echo "<td>" . $row['SYSDATE()'] . "</td>";
echo "</tr>";
echo "</tbody>";
}
echo "</table>";
mysql_close($con);
?>
Please note that tomorrowtime is a row in the MySQL proposal table. What i want to do is have a third column called "Time Left" which will basically show the difference between the Current Time (SYSDATE) and the Tomorrow Time. Can anyone please advise how i can print this out in the third column.
Any advice would be greatly appreciated.
Thank you