So mein forum funktioniert FAST.
Ich kann neue threads erstellen die auch in der tabelle threads abgespeichert
werden, so weit so gut.
Allerdings werden nur der topic und die id gespeichert, die nachricht die dann in der
tabell answers abgeschpeichert weden soll, funktioniet nicht, ebenso auf ein
thread zu antworten funktioniert nicht. Die daten werden einfach nicht abgespeichert.
Das kommt im newthread_script an:
array(5) { ['fid']=> string(1) "1" ['name']=> string(5) "Frank" ['topic']=> string(4) "Test" ['nachricht']=> string(11) "Testbeitrag" ['send']=> string(10) "Abschicken" }
Hier ist das Script:
<?PHP /* newthread_script.php */
include("DB_open.php");
include("error.php");
$nachricht = $_POST["nachricht"];
$topic = $_POST["topic"];
$name = $_POST["name"];
$fid = $_POST["fid"];
$eintragthread = "INSERT INTO threads (fid, topic) VALUES ($fid, '$topic')";
$set = mysql_query($eintragthread);
$res = mysql_query("select max(id) AS max from threads");
$row = mysql_fetch_array($res);
$thread_id = $row["max"];
$eintraganswers = "INSERT INTO answers (tid, fid, user,topic, text) VALUES ($thread_id, $fid, '$name', '$topic', '$nachricht')";
$set = mysql_query($eintraganswers);
//header("Location: showthreads.php?fid=".$fid);
var_dump($_POST)
?>
Alles anzeigen
und das hier kommt im newanswers_script an:
array(6) { ['fid']=> string(1) "1" ['tid']=> string(2) "16" ['name']=> string(5) "Frank" ['topic']=> string(4) "Test" ['nachricht']=> string(5) "Hallo" ['send']=> string(10) "Abschicken" }
und hier das Script:
<?PHP /* newanswer_script.php */
include("DB_open.php");
include ("error.php");
$nachricht = $_POST["nachricht"];
$topic = $_POST["topic"];
$name = $_POST["name"];
$fid = $_POST["fid"];
$tid = $_POST["tid"];
$eintragb = "INSERT INTO answers (tid, fid, user,topic, text) VALUES ($tid, $fid, '$name', '$topic', '$nachricht')";
$set = mysql_query($eintragb);
//header("Location: showanswers.php?fid=".$fid."&tid=".$tid);
var_dump($_POST)
?>
Alles anzeigen
PLEASE ME!!!!!!!