Jump to content

Using the ?= address command


futurewii

Recommended Posts

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  :)

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.