<?php
include 'inc/db.php';
function dateDiff($start, $end) {
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return floor($diff / 86400);
}
$q ="SELECT * FROM date";
$p=mysql_query($q);
while ($res=mysql_fetch_array($p))
{
$start =$res['sdate'];
}
$qc ="SELECT * FROM accounts";
$pc=mysql_query($qc);
while ($r=mysql_fetch_array($pc))
{
$elecend=$r['elec_contract_edate'];
$gasend=$r['gas_contract_edate'];
$elecshow =dateDiff( $start,$elecend );
$gasshow =dateDiff( $start,$gasend );
echo $elecshow."\tDays Remaining";
echo $gasshow."\tDays Remaining";
}
?>
im getting this output "-15920 Days Remaining 0 Days Remaining8 Days Remaining11 Days Remaining "
i want to eliminate -15920 Days Remaining 0 Days kindly help me out