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
https://forums.phpfreaks.com/topic/56210-solved-error-in-displaying-mysql/
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() ;
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.