Hallo,
habe nachfolgende Script für meine Bedürfnisse umgewandelt.
Leider habe ich aber darin einen Fehler.
Ich bekomme immer nur den letzten Eintrag aus der Datenbank
Was muss ich ändern um die letzten 25 Einträge zu erhalten.
habe nachfolgende Script für meine Bedürfnisse umgewandelt.
Leider habe ich aber darin einen Fehler.
Ich bekomme immer nur den letzten Eintrag aus der Datenbank
Was muss ich ändern um die letzten 25 Einträge zu erhalten.
PHP Code:
<?php
/*
* You may not remove this header!
*
* -----------------------------------------------------------------------------------------------------------------------
* 'pilot_roster.php' script code was made by Paulo Correia - FSAcars Team (©)2003
* It's part of the FSAcars 2 for VA's package
*
* This script assumes that the VA has PHP support and a MySQL database on it's site
* ----------------------------------------------------------------------------------------------------------------------
*
* FSACARS is distributed freely.
*
* Disclaimer
* Although this product has been intensively tested, the authors accepts no responsibility for any damages caused by the use or misuse of this
* software. This software is distributed 'as is' with no warranty expressed or implied. The authors will not be responsible for any losses incurred, either directly or indirectly, by the use of this software.
* Use this software entirely at your own risk. If you do not agree to these terms then you must not use this software.
*
* Copyright
* This software is a copyrighted program. AIBridge is a copyright of José Oliveira. FSACARS coding is a copyright of José Oliveira. FSACARS concept was idealized by Pedro Sousa.
* It is protected by international copyright laws.
*/
/* Constants */
@define ("MYSQL_CONNECT_INCLUDE", "connect_db.php"); // MySQL database connection (a sample file is included)
/* Database connection */
include(MYSQL_CONNECT_INCLUDE);
/* Select all pilots */
$query = "SELECT * FROM reports ORDER BY pilot_id =032 ASC";
$result = mysql_query($query);
/* Determine the number of pilots */
$numbers = mysql_numrows($result);
if ($numbers > 0) {
/* Print roster header
Change this HTML to fit your webpage layout */
print "<table>";
print "<tr>";
print "<td bgcolor=#000080 width=73 height=12 align=left><font face=Arial color=#FFFFFF size=2><b>Datum</b></font></td>";
print "<td bgcolor=#000080 width=73 height=12 align=left><font face=Arial color=#FFFFFF size=2><b>Callsign</b></font></td>";
print "<td bgcolor=#000080 width=73 height=12 align=left><font face=Arial color=#FFFFFF size=2><b>Start</b></font></td>";
print "<td bgcolor=#000080 width=73 height=12 align=left><font face=Arial color=#FFFFFF size=2><b>Landung</b></font></td>";
print "<td bgcolor=#000080 width=73 height=12 align=left><font face=Arial color=#FFFFFF size=2><b>Flugzeit</b></font></td>";
print "</tr>";
/* Get pilots info */
for ($i=0; $i<$numbers; $i++) {
$date = mysql_result($result,$i,"date");
$callsign = mysql_result($result,$i, "callsign");
$origin_id = mysql_result($result,$i, "origin_id");
$destination_id = mysql_result($result,$i, "destination_id");
$duration = mysql_result($result,$i, "duration");
}
/* Display roster entries */
print "<tr>";
print "<td width=73 height=12 align=left><font face=Arial size=2 color=#000080>$date</font></td>";
print "<td width=73 height=12 align=left><font face=Arial size=2 color=#000080>$callsign</font></td>";
print "<td width=73 height=12 align=left><font face=Arial size=2 color=#000080>$origin_id</font></td>";
print "<td width=73 height=12 align=left><font face=Arial size=2 color=#000080>$destination_id</font></td>";
print "<td width=73 height=12 align=left><font face=Arial size=2 color=#000080>$duration</font></td>";
print "</tr>";
}
print "</table>";
/* Print table footer */
print "<table>";
print "<tr><td><font face=Arial size=1 color=gray>Powered by FSACARS for VA's - http://www.satavirtual.org/fsacars/</font></td></tr>";
print "</table>";
/* Close the database connection */
mysql_close();
?>
Comment