• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Option in Datenbank eintragen

Status
Für weitere Antworten geschlossen.

Jeremygolf

Mitglied
Hallo ich habe schon mal so einen Thread geschrieben aber nichts hat geklappt.
Nun meine Frage: Ich hape ein ein Select Feld indem 2 Option's sind nun möchte ich, dass man die Ausgewählte Option in eine Datebank schreibt wie geht das?

Hier noch mein CODE

Code:
$kategorie = $_POST["kategorie"];

$sql_insert= mysql_query("INSERT INTO `news` VALUES ('$id', '$kategorie', now(), '$titel', '$bild', '$text')") or die (mysql_error());


<form action="news.php" method="post">
			Kategorie: <br/><br/>
				<select name="my_option">
					<option value="<?php echo $kategorie; ?>">Normal</option>
					<option value="<?php echo $kategorie; ?>">Frucht des Monats</option>
				</select><br/><br/>
			Titel: <br /> <input name="titel" type="text" value="<?php echo $titel; ?>" /><br />
			Bild: <br /> <input name="bild" type="text" value="<?php echo $bild; ?>" /><br />
			Bild: <br /> <input style="border: none;" name="bild" type="file" value="<?php echo $bild; ?>" /><br /> 
			Text: <br /> <textarea name="text" cols="35" rows="10" value="<?php echo $text; ?>"></textarea><br /> 
			<input class="button" name="submit" type="submit" value="Publizieren" />
			</form>
 
Status
Für weitere Antworten geschlossen.
Zurück
Oben