My problem is very simple; I want to add new rows to the table using a form.
My table:
Code: Select all
CREATE TABLE mtrade_forum (
threadtopic varchar(40),
threadcontent text,
userid integer,
createddate timestamp,
lastreplydate timestamp,
lastreplyby varchar(30),
replies integer,
replythread varchar(10),
sticky boolean default 'f',
threadid SERIAL PRIMARY KEY,
FOREIGN KEY(userid)
REFERENCES mtrade_members
);My insert page: (is run from a page with a form that includes values for $threadtopic2 and $threadcontent2)
Code: Select all
<?php session_start();
include ("locked.php"); ?>
<?php
include "dbconnect.php";
INSERT INTO mtrade_forum VALUES (
'$threadtopic2', //threadtopic - The topic-field in the form
'$threadcontent2', //threadcontent - The content-field in the form
'$sessuserid', //userid - Userid from the session
'$now', //createddate - The date and time
'$now', //lastreplydate - The date and time
'$sessuserid', //lasteplyby - Userid from the session
'0', //replies - The value 0 (zero)
'0' //replythread - The value 0 (zero)
);
?>But when I run the code, I get a problem pointing to line 7 ("INSERT INTO mtrade_forum VALUES (")
It's probably something really dumb, but I don't know what it is.. Hope that someone can help me.
Thanx in advance
// Caliber