473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1259
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

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

Similar topics

8
by: Keith | last post by:
Say I write a little c# client and have a database. I want multiple people to use the client, which will display a datagrid, or tree control with data from the databse. The client will allow...
1
by: Simon Bailey | last post by:
I currently have a query calculating the gap in days between two dates. The fields being "DateLookedAt" and "DateResolved" plus the calculated field "TimeTaken". I am looking to add another...
10
by: john_aspinall | last post by:
Hi, I got a bit of problem with Access and was wondering if someone could enlighten me. I'm building a database of products of sale, complete with images. Im importing the product data from...
13
by: kimiraikkonen | last post by:
Hello, I have an aritmetic calculation like this: First note that: i need a "timer" to get the value for value3. (however removing "timer" didn't differ) Dim value1 As Long Dim value2 As...
5
by: Bakarre | last post by:
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",...
0
by: remya1000 | last post by:
I have a field called Departments in my database. and I have 3 monitors. So when Page_Load, I need to check number of departments I have in database. And depends upon that number of departments I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.