473,609 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To display a field from databse and calculate time different

8 New Member
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("SE LECT 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_arr ay($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 1271
ronverdonk
4,258 Recognized Expert Specialist
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
306
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 updates, insertions, deletes of data that is populated from a table in the database. Now, how do I get the client to show real time updates? So that if user (A) deletes a record or changes a field, user (B) sees it right away ? Should I use:
1
8530
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 field to my report (or does this have to be created in the query?) that calculates the average of all the data in the "Time Taken" field. SQL code or some tips would be much appreciated.
10
1593
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 a CSV file into an access databse. The two main fields Im concerned with are called 'ProductID' and 'ImagePath'.
13
2305
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 String Dim value3 As String value3 = (value2 * 8) / value1
5
986
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", "****", "********"); mysql_select_db("FDP",$db); if (isset($_POST))
0
1702
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 have, I need to calculate number of checkbox I need to display. NumCheckBox = NumDepartments * 3 And then I need to create a table like structure with 4 fields. First column -Department Name and remaining 3 columns will be Monitor 1-3. and...
0
8067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8567
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8215
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8398
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.