Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

discussion forum for IIS 6

Status
Not open for further replies.

demion

Instructor
Mar 16, 2005
1
GR
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!
 
I recommend that you print your insert query to the browser and examine it. Does it look right?

Then open Access and copy-and-paste the query into a new query in Access. Does it run right?

What is the value of $resultupdate after the invocation of odbc_exec()? Is it FALSE?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top