Jump to content

[SOLVED] Error In Displaying MYSQL


jfs0479

Recommended Posts

Hi All,

 

I am having this problem at the moment with this script below. The probelm is that it keeps on chucking out an error:

Parse error: parse error, unexpected $end in index.php on line 559

 

Online 559 is just the close of the html tag outside of the php.

 

Thanks for the help :)

 

James

 

<?php 
					  include("db.php");
					  $nowdate = date('d/m/Y');
					  $query = "SELECT * FROM arab_flights WHERE date='$nowdate' ORDER BY flightid DESC";
					  $result= mysql_query($query);
					  $timenow = date('H:i:s');
					  //Applying the variables for the extraction
					  while($myrow = mysql_fetch_array($result))

        {

				$flightid = $myrow['flightid'];

				$departing = $myrow['departing'];

				$arriving = $myrow['arriving'];

				$aircraft = $myrow['aircraft'];

				$memberid = $myrow['memberid'];

				$time_startgate = $myrow['time_startgate'];

				$time_starttaxi = $myrow['time_starttaxi'];

				$time_startclimb = $myrow['time_startclimb'];

				$time_startcruise = $myrow['time_startcruise'];

				$time_startapproach = $myrow['time_startapproach'];

				$time_arrivedgate = $myrow['time_arrivedgate'];

				//Working Out Their Status
				if ($timenow > $time_startgate) {
    $status=("At Gate"); 
} elseif ($timenow > $time_starttaxi) {
    $status=("Taxi");
} elseif ($timenow > $time_startclimb) {
$status=("Climbing");
} elseif ($timenow > $time_startcruise) {
$status=("cruise");
} elseif ($timenow > $time_startapproach) {
$status=("approach");
} elseif ($timenow > $time_arrivedgate) {
$status=("Arrived");
} else {
    $status=("NA");
}
$data =("$status");							
                            $dislpay = '<td height="28" class="content_table">' . $flightid . '</td>
                            <td width="143" class="content_table">' . $departing . '</td>
                            <td width="135" class="content_table">' . $arriving . '</td>
                            <td width="134" class="content_table">' . $aircraft . '</td>
                            <td width="102" class="content_table">' . $memberid . '</td>
                            <td width="149" class="content_table">' . $data . '</td>';
						echo "$display";
						mysql_close() ?>

Link to comment
Share on other sites

 

I do not think I said remove the } I said you are missing/do not have the closing bracket for the while loop...

 

<?php
include("db.php");
					  $nowdate = date('d/m/Y');
					  $query = "SELECT * FROM arab_flights WHERE date='$nowdate' ORDER BY flightid DESC";
					  $result= mysql_query($query);
					  $timenow = date('H:i:s');
					  //Applying the variables for the extraction
					  while($myrow = mysql_fetch_array($result))

        {

				$flightid = $myrow['flightid'];

				$departing = $myrow['departing'];

				$arriving = $myrow['arriving'];

				$aircraft = $myrow['aircraft'];

				$memberid = $myrow['memberid'];

				$time_startgate = $myrow['time_startgate'];

				$time_starttaxi = $myrow['time_starttaxi'];

				$time_startclimb = $myrow['time_startclimb'];

				$time_startcruise = $myrow['time_startcruise'];

				$time_startapproach = $myrow['time_startapproach'];

				$time_arrivedgate = $myrow['time_arrivedgate'];

				//Working Out Their Status
				if ($timenow > $time_startgate) {
    $status=("At Gate"); 
} elseif ($timenow > $time_starttaxi) {
    $status=("Taxi");
} elseif ($timenow > $time_startclimb) {
$status=("Climbing");
} elseif ($timenow > $time_startcruise) {
$status=("cruise");
} elseif ($timenow > $time_startapproach) {
$status=("approach");
} elseif ($timenow > $time_arrivedgate) {
$status=("Arrived");
} else {
    $status=("NA");
}
$data =("$status");							
                            $dislpay = '<td height="28" class="content_table">' . $flightid . '</td>
                            <td width="143" class="content_table">' . $departing . '</td>
                            <td width="135" class="content_table">' . $arriving . '</td>
                            <td width="134" class="content_table">' . $aircraft . '</td>
                            <td width="102" class="content_table">' . $memberid . '</td>
                            <td width="149" class="content_table">' . $data . '</td>';
						echo "$display";
}

mysql_close() ;
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.