jfs0479 Posted June 19, 2007 Share Posted June 19, 2007 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() ?> Quote Link to comment https://forums.phpfreaks.com/topic/56210-solved-error-in-displaying-mysql/ Share on other sites More sharing options...
per1os Posted June 19, 2007 Share Posted June 19, 2007 You do not have the closing } for the while loop. Quote Link to comment https://forums.phpfreaks.com/topic/56210-solved-error-in-displaying-mysql/#findComment-277630 Share on other sites More sharing options...
jfs0479 Posted June 19, 2007 Author Share Posted June 19, 2007 Just tried removing this closing } but it still is showing the error Quote Link to comment https://forums.phpfreaks.com/topic/56210-solved-error-in-displaying-mysql/#findComment-277640 Share on other sites More sharing options...
per1os Posted June 19, 2007 Share Posted June 19, 2007 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() ; ?> Quote Link to comment https://forums.phpfreaks.com/topic/56210-solved-error-in-displaying-mysql/#findComment-277646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.