469,944 Members | 2,305 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,944 developers. It's quick & easy.

To display a field from databse and calculate time different

To display a field from databse and calculate time different
--------------------------------------------------------------------------------

Good day,
i have problem to display a field from databse and calculate time different.
See below my code.

I hope somebody can fix the problem for me.

<?php
$db = mysql_connect("localhost", "****", "********");
mysql_select_db("FDP",$db);
if (isset($_POST['clearance']))
{
$result = mysql_query("SELECT cs, tac, eta, eat, fl, du FROM aeroarrival WHERE DATE = current_date and TIMEDIFF( eta, current_time ) <= '00:30:00' as tmdif
ORDER BY ETA",$db);
$myrow = mysql_fetch_array($result)

echo ($row['CS']);
echo ($row['tmdif']);

$CTIME1 = DATE('H : i : s');
$CTIME = $CTIME1 - $EAT;
//echo 'cs';
if ($CTIME < '00:15:00')
echo "DontClear!";
elseif ($CTIME < '00:20:00')
echo "SemiClear!";
else if ($CTIME > '00:20:00')
echo "Clear!";
else {
echo "GoodClear!";
}
}
?>
Feb 7 '08 #1
1 1123
ronverdonk
4,258 Expert 4TB
To get a clearer understanding you have to describe the problem you require help for. I do not like crossword puzzles.

Ronald
Feb 10 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Keith | last post: by
1 post views Thread by Simon Bailey | last post: by
13 posts views Thread by kimiraikkonen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.