Hi zusammen,
versuche schon seit Stunden den Insert zu machen.
Aber irgentwie will er dies nicht tun.
Ne frage auch.
Kann man auch einen $row dings in eine Insert machen?
versuche schon seit Stunden den Insert zu machen.
Aber irgentwie will er dies nicht tun.
Ne frage auch.
Kann man auch einen $row dings in eine Insert machen?
PHP-Code:
<?php
include('funktion/config.php');
include('funktion/date.php');
$gebuebay1 = 0.0;
$gebuebay2 = 0.5;
$verkaufebay1 = 0.0;
$verkaufebay2 = 10/100;
$gebupayp1 = 0.0;
$gebupayp2 = 0.5;
$monat=date("m");
$jahr=date("Y");
if(isset($_POST['add'])){
$db_preis = $_POST["add_porto"];
//Hier mal die eingegebenen Daten noch prüfen.
//mit htmlspecialchars und dem Skript für Umlaute
$eintrag = "INSERT INTO gewinn
(db_preis)
VALUES
('$db_preis')";
$eintragen = mysql_query($eintrag);
}
?>
<html>
<head>
<title>Karte hinzufügen</title>
</head>
<table border="1" cellspacing="0" cellpadding="0" align="center" width="100%">
<?php
include('funktion/header.php');
include('funktion/menu.php');
?>
<a href="index.php">Startseite</a> ⇒ Karte hinzufügen
</td>
</tr>
<tr>
<td>
<body>
<form id="Sprache" name="Sprache" method="POST" action="gewinn_list.php">
<table width="25%" border="1" align="center">
<tr align="center">
<td><b>IMG</b></td>
<td><b>DATUM</b></td>
<td><b>Verkauspreis</b></td>
<td><b>Verkaufsversand</b></td>
<td><b>Porto</b></td>
<td><b>Versand</b></td>
<td><b>Ebay Gebühr</b></td>
<td><b>Ebay Verkaufsprovision</b></td>
<td><b>Paypal Gebühr</b></td>
<td><b>Aktionen</b></td>
</tr>
<?php
$query = "
SELECT
karte.nameid,
karte.id AS kaID,
karte.db_sell_preis AS sell_preis,
rechnung.db_sell_versand AS versand_preis,
karte_name.id
FROM
karte
INNER JOIN
karte_name
ON
karte.nameid = karte_name.ID
INNER JOIN
rechnung
WHERE
db_sell_preis > 0.01";
$rs = mysql_query($query) OR die("Error: ".mysql_error()."</ br> Zeile ".__LINE__);
while($row = mysql_fetch_array($rs)) {
?>
<tr align="center">
<?php
echo "<td><img class='image' src='img/karte/".$row['id'].".png' width='30' height='45' alt='-'/></td>";
echo "<td><select size=1 name=monat><option>" . $monat . "</option></select>
<select size=1 name=jahr><option>" . $jahr . "</option></select></td>";
echo "<td>" . $row['sell_preis'] . "</td>";
echo "<td>" . $row['versand_preis'] . "</td>";
?>
<td><?php $query = "SELECT * FROM porto ORDER BY preis"; $resultat = mysql_query($query) or die ("Konnte Abfrage nicht ausführen."); ?>
<select name="add_porto"> <?php while($zeile = mysql_fetch_assoc($resultat)) { extract($zeile); echo "<option name='add_porto' value='".$preis."'>$preis €</option>\n"; } ?></select></td>
<td><?php $query = "SELECT * FROM versand ORDER BY preis"; $resultat = mysql_query($query) or die ("Konnte Abfrage nicht ausführen."); ?>
<select name="add_versand"> <?php while($zeile = mysql_fetch_assoc($resultat)) { extract($zeile); echo "<option name='add_rarity' value='".$preis."'>$preis €</option>\n"; } ?></select></td>
<?php
echo "<td><select size='1'>
<option name='add_gebuebay' value='".$gebuebay1."'>$gebuebay1</option>
<option name='add_gebuebay' value='".$gebuebay2."'>$gebuebay2</option>
</select></td>";
echo "<td><select size='1'>
<option name='add_verkaufebay' value='".$verkaufebay1."'>$verkaufebay1</option>
<option name='add_verkaufebay' value='".$verkaufebay2."'>$verkaufebay2</option>
</select></td>";
echo "<td><select size='1'>
<option name='add_gebupayp' value='".$gebupayp1."'>$gebupayp1</option>
<option name='add_gebupayp' value='".$gebupayp2."'>$gebupayp2</option>
</select></td>";
// echo "<td>" . ($row['sell_preis'] + $row['versand_preis']) . "</td>";
echo "<td><input type='submit' name='add' id='button' value='Speichern' /></td>";
}
?>
</tr>
<?php
if(isset($_POST['add'])){
if($eintragen == true) {
echo "<tr><td colspan='7' align='center'><font color='#green'>Die Karte wurde eingetragen</font></td></tr>";
} else {
echo "<tr><td colspan='7' align='center'><font color='#red'>Fehler im System. Konnte nicht abgespeichert werden</font></td></tr>";
}
}
?>
</table>
</form>
</body>
</td>
</tr>
<?php
include('funktion/footer.php');
?>
</table>
</html>

Kommentar