futurewii Posted May 19, 2009 Share Posted May 19, 2009 Hello all again. I have finished the page I had a slight bug with earlier. Now I'm trying to work out how to get the links on it to work. If you take a look here.. http://flyonesky.org/new_tmp/schedules.php You can see that the flight numbers are links. When you click it, it takes you to "flightinfo.php?id=FLIGHTNUMBER". I am just testing it with the first field at the moment on that page, which I am using this code for.. <?php $result = mysql_query("SELECT * FROM flights WHERE flightno = '".$_GET['flightno']."'") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { echo $row['flightno']; } ?> But for some reason it doesn't come up with any error it just appears blank. Here is the code from the Schedules Page for the table.. <?php $query = "SELECT * FROM flights"; $result = mysql_query($query); $date_month_ago = date("d-n-Y") - 2592000; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { print "<tr>"; print "<td><a href='flightinfo.php?id=".$row['flightno']."'>".$row['flightno']."</td>"; print "<td>"; echo $row['depname']; print "</td>"; print "<td>"; print "<a href='airportinfo.php?id=".$row['dep']."'>"; echo $row['dep']; print "</a>"; print "</td>"; print "<td>"; echo $row['arrname']; print "</td>"; print "<td>"; print "<a href='airportinfo&id=".$row['arr']."'>"; echo $row['arr']; print "</a>"; print "</td>"; print "<td>"; echo $row['deptime']; print "</td>"; print "<td>"; echo $row['arrtime']; print "</td>"; print "<td>"; if($row['mon'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['mon'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; if($row['tue'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['tue'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; if($row['wed'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['wed'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; if($row['thu'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['thu'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; if($row['fri'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['fri'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; if($row['sat'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['sat'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; if($row['sun'] ==0){ include 'images/icons/bdot.php'; } elseif ($row['sun'] >0) { include 'images/icons/gdot.php'; } print "</td>"; print "<td>"; echo $row['flown']; print "</td>"; print "<td>"; echo $row['aircraft']; print "</td>"; print "</tr>"; } ?> </table> Any suggestions anyone Quote Link to comment Share on other sites More sharing options...
Masna Posted May 19, 2009 Share Posted May 19, 2009 $_GET['id'] Quote Link to comment Share on other sites More sharing options...
futurewii Posted May 19, 2009 Author Share Posted May 19, 2009 That just links back to the PHPfreaks homepage? Quote Link to comment 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.