<?php
include_once '../include/connections.php';
$id =$_REQUEST['uid'];
$result= mysql_query("SELECT * FROM data WHERE uid = '$id'");
$test = mysql_fetch_array($result);
echo $test[14];
echo "<br /><br />";
$today=time();
$enddate=strtotime('$test[14]');
$timediff = $enddate - $today;
$days=intval($timediff/86400);
$remaining=$timediff%86400;
$hours=intval($remaining/3600);
$remaining=$remaining%3600;
$mins=intval($remaining/60);
$secs=$remaining%60;
echo "<br>".$days.' days '.$hours.' hours '.$mins.' minutes and '.$secs.' seconds.';
?>
When i echo $test[14]; i get the date and time as stored in the database which is (2012-09-26 00:00:00) When i echo $today then i get it in this format 1348381896. Now how do i convert this format to the one retrieved from the db so that i can subtract the 2 dates and get the number of days and time left.

New Topic/Question
Reply



MultiQuote





|