Jump to content

Display over multiple pages


cloudsurferuk

Recommended Posts

Hi Guys, need some of your expert help again. I use the following code to display results from a database but often there are hundreds of results, how can I get this to display over multiple pages i.e. 50 results per page. (i know this seems basic but I am still basic with PHP)

   $result = mysql_query("SELECT * FROM routes WHERE Airline = '$carrier' AND DepID = '$hub' OR Airline = '$carrier' AND ArrID = '$hub' ORDER BY DepID, DepTime ASC");
   // make box and name the fields in html
  echo "<table border='0' cellpadding='2' cellspacing='2'>
  <tr>
  <th>Flight Number</th>
  <th>Departure ICAO</th>
  <th>Block Off</th>
  <th>Arrival ICAO</th>
  <th>Block On</th>
  <th>Aircraft</th>
  <th>Info</th>
  <th>Average Duration</th>
  </tr>";
  // fill box with data
  while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['FlightNo'] . "</td>";
  echo "<td>" . $row['DepID'] . "</td>";
  echo "<td>" . $row['DepTime'] . "</td>";
  echo "<td>" . $row['ArrID'] . "</td>";
  echo "<td>" . $row['ArrTime'] . "</td>";
  echo "<td>" . $row['Equip'] . "</td>";
  echo "<td>" . $row['Extra'] . "</td>";
  echo "<td>" . $row['Avg_Dur'] . "</td>";
  echo "</tr>";
  }
  echo "</table>";

 

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.