Also mein erstes Problem:
PHP-Code:
<?php include("dbconnect.php") ?>
<?php
$abfrage = "SELECT * FROM addons_fsx";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
//Aircraft and green
if($row->typ == "aircraft" and $row->komp == 1 and $row->frei == 1)
{
echo "
<h3>Aircraft</h3>
<table>
<tr><td><font color='#00FF00'> $row->name</td><td> ($row->komment)</td><td> <a href='$row->tofsx' target='_blank'>[FS9toFSX]</font></a></td></tr>
</table>
";
}
//Aircraft and organge
if($row->typ == "aircraft" and $row->komp == 2 and $row->frei == 1)
{
echo "
<table>
<tr><td><font color='#FF6633'> $row->name</td><td> ($row->komment)</td><td> <a href='$row->tofsx' target='_blank'>[FS9toFSX]</font></a></td></tr>
</table>
";
}
//Aircraft and red
if($row->typ == "aircraft" and $row->komp == 3 and $row->frei == 1)
{
echo "
<table>
<tr><td><font color='#FF0000'> $row->name</td><td> ($row->komment)</td><td> <a href='$row->tofsx' target='_blank'>[FS9toFSX]</font></a></td></tr>
</table>
";
}
?>
Hier wied das erste "if" korrect ausgegeben aber das 2. und 3. nicht. zu sehen hier:
http://ucc.uc.funpic.de/php/fs9tofsx.php
Jetzt zum 2.:
Das Formular:
PHP-Code:
<?php
session_start();
?>
<form method="post" action="entry_send.php">
<table width="556" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="193">From: </td>
<td width="363"><label>
<input name="from" type="text" id="from" maxlength="4" />
</label></td>
</tr>
<tr>
<td>To:</td>
<td><input name="to" type="text" id="to" maxlength="4" /></td>
</tr>
<tr>
<td>Date:</td>
<td><input name="date" type="text" id="date" maxlength="10" /></td>
</tr>
<tr>
<td>Airline:</td>
<td><input name="airline" type="text" id="airline" /></td>
</tr>
<tr>
<td>Flightnummer:</td>
<td><input name="flightnr" type="text" id="flightnr" /></td>
</tr>
<tr>
<td>Aircraft:</td>
<td><input name="aircraft" type="text" id="aircraft" /></td>
</tr>
<tr>
<td>Flightlevel:</td>
<td><input name="fl" type="text" id="fl" maxlength="5" /></td>
</tr>
<tr>
<td>DEP:</td>
<td><input name="dep" type="text" id="dep" /></td>
</tr>
<tr>
<td>ARR:</td>
<td><input name="arr" type="text" id="arr" maxlength="5" /></td>
</tr>
<tr>
<td>FUEL off:</td>
<td><input name="fueloff" type="text" id="fueloff" />
LBS </td>
</tr>
<tr>
<td>FUEL on:</td>
<td><input name="fuelon" type="text" id="fuelon" />
LBS </td>
</tr>
<tr>
<td>FUEL used:</td>
<td><input name="fuelused" type="text" id="fuelused" />
LBS </td>
</tr>
<tr>
<td>Block off (GTM/UTC):</td>
<td><input name="blockoffgtm" type="text" id="blockoffgtm" maxlength="5" />
/
<input name="blockoffutc" type="text" id="blockoffutc" maxlength="5" /></td>
</tr>
<tr>
<td>DEP time (GTM/UTC):</td>
<td><input name="deptimegtm" type="text" id="deptimegtm" maxlength="5" />
/
<input name="deptimeutc" type="text" id="deptimeutc" maxlength="5" /></td>
</tr>
<tr>
<td>ARR time (GTM/UTC):</td>
<td><input name="arrtimegtm" type="text" id="arrtimegtm" maxlength="5" />
/
<input name="arrtimeutc" type="text" id="arrtimeutc" maxlength="5" /></td>
</tr>
<tr>
<td>Block on (GTM/UTC):</td>
<td><input name="blockongtm" type="text" id="blockongtm" maxlength="5" />
/
<input name="blockonutc" type="text" id="blockonutc" maxlength="5" /></td>
</tr>
<tr>
<td>Block time: </td>
<td><input name="blocktime" type="text" id="blocktime" maxlength="4" /></td>
</tr>
<tr>
<td>Flight time: </td>
<td><input name="flighttime" type="text" id="flighttime" maxlength="4" /></td>
</tr>
<tr>
<td>Kommentar:</td>
<td><label>
<textarea name="kommentar" id="kommentar"></textarea>
</label></td>
</tr>
</table>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
und hier die send datei:
PHP-Code:
<?php session_start(); ?>
<?php include("dbconnect.php") ?>
<?php
$date = $_POST['date'];
$from = $_POST['from'];
$to = $_POST['to'];
$dep = $_POST['dep'];
$arr = $_POST['arr'];
$flightnr =$_POST['flightnr'];
$airline = $_POST['airline'];
$aircraft = $_POST['aircraft'];
$fl = $_POST['fl'];
$fueloff = $_POST['fueloff'];
$fuelon = $_POST['fuelon'];
$fuelused = $_POST['fuelused'];
$blockoffgtm = $_POST['blockoffgtm'];
$blockoffutc = $_POST['blockoffutc'];
$deptimegtm = $_POST['deptimegtm'];
$deptimeutc = $_POST['deptimeutc'];
$arrtimegtm = $_POST['arrtimegtm'];
$arrtimeutc = $_POST['arrtimeutc'];
$blockongtm = $_POST['blockongtm'];
$blockonutc = $_POST['blockonutc'];
$blocktime = $_POST['blocktime'];
$flighttime = $_POST['flighttime'];
$kommentar = $_POST['kommentar'];
$eintrag = "INSERT INTO b787_logbook (date, from, to, dep, arr, flightnr, airline, aircraft, fl, fueloff, fuelon, fuelused, blockoffgtm, blockoffutc, deptimegtm, deptimeutc, arrtimegtm, arrtimeutc, blockongtm, blockonutc, blocktime, flighttime, kommentar)
VALUES
('$date', '$from', '$to', '$dep', '$arr', '$flightnr', '$airline', '$aircraft', '$fl', '$fueloff', '$fuelon', '$fuelused', '$blockoffgtm', '$blockoffutc', '$deptimegtm', '$deptimeutc', '$arrtimegtm', '$arrtimeutc', '$blockongtm', '$blockonutc', '$blocktime', '$flighttime', '$kommentar')";
$eintragen = mysql_query($eintrag);
if($eintragen == true)
{
echo "<font color='#00FF00'>Eintrag war erfolgreich</font><p>";
}
else
{
echo "<font color='#FF0000'>Fehler beim Speichern</font><p>";
}
echo mysql_errno() . ": " . mysql_error() . "\n";
?>
Doch es kommt immer ein Fehler:
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from, to, dep, arr, flightnr, airline, aircraft, fl, fueloff, fuelon, fuelused, ' at line 1
Kann mir jemand bitte Helfen?