Supportnet / Forum / Skripte(PHP,ASP,Perl...)
problem beim speichern mehrer var in mysql
Frage
hallo
ich hab net tabelle namens vote und zwei spalten frage und antwort jetzt will mit einem formular gleich mehrer antworten speichern geth aber nicht! Wie kann ich das lösen
speichern
include ("./../db.php");
mysql_query("INSERT INTO
lpp_vote(frage,antwort,antwort,antwort,antwort,antwort,antwort,antwort,antwort,antwort,antwort)VALUES('$frage','$one','$two','$drei','$vier','$fünf','$six','$seven','$acht','$nine','$ten')");
Antwort 1 von Nessus
Hi,
FAQ der NG de.comp.lang.php
HTH
Nessus
<?
$host = "localhost";
$user = "";
$password = "";
$database = "";
mysql_connect($host,$user,$password)
or die("Abbruch: Verbindung zu '$host'"
." konnte nicht hergestellt werden.");
mysql_select_db($database)
or die("Abbruch: Datenbank '$database' konnte nicht"
." selektiert werden.<br><br>MySQL sagt: ".mysql_error());
$query = "INSERT INTO `VOTE` (`FRAGE`,`ANTWORT1`,`ANTWORT2`.............) VALUES ('".$FRAGE."','".$ANTWORT1."', '".$ANTWORT2."'.............)";
mysql_query($query);
?>
FAQ der NG de.comp.lang.php
HTH
Nessus

