I'm trying to create a discussion forum for an IIS 6 site using php. My database for the discussion threads is in MS Access. I 'm using a ODBC connection on a W2k3 machine with the DSN of the database (it's called "forum", the same as the table). The problem is that the php script cannot write in the database (looks like the insert into does not work). A small excerpt is below:
<?
$connect=odbc_connect("forum","iusr_moonchild","P@ssw0rd");
if(isset($submit))//check if submitted button is clicked
{
//insert the record in the database
$resultupdate=odbc_exec($connect,"insert into forum
(parentcode,title,description,uname,email) VALUES('$node','$title','$description','$postname','$email')");
header("location:forum.php"); //open forum.php file to display the thread
exit;
}
?>
The fields email, postname, description etc are names in an html form
Any help would be much appreciated!
<?
$connect=odbc_connect("forum","iusr_moonchild","P@ssw0rd");
if(isset($submit))//check if submitted button is clicked
{
//insert the record in the database
$resultupdate=odbc_exec($connect,"insert into forum
(parentcode,title,description,uname,email) VALUES('$node','$title','$description','$postname','$email')");
header("location:forum.php"); //open forum.php file to display the thread
exit;
}
?>
The fields email, postname, description etc are names in an html form
Any help would be much appreciated!