By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,569 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,569 IT Pros & Developers. It's quick & easy.

To display a field from databse and calculate time different

P: 8
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
Share this Question
Share on Google+
1 Reply


ronverdonk
Expert 2.5K+
P: 4,258
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.