Log In · Register

 
Help!, Php & Mysql problem
nightmareutopia
post Feb 9 2008, 11:30 PM
Post #1


Newbie
*

Group: Member
Posts: 8
Joined: Nov 2007
Member No: 592,112



So my code is:

CODE
<?php
// Acquire Settings
require_once('../includes/DbConnector.php');

// Check whether a form has been submitted. If so, carry on
if ($HTTP_POST_VARS){

// Create a new instance of DbConnector
$connector = new DbConnector();

// Form Validation

// Create an SQL query
$insertQuery = "INSERT INTO articles (article_title,author_name,category,article_text) VALUES (".
"'".$HTTP_POST_VARS['article_title']."', ".
"'".$HTTP_POST_VARS['author_name']."', ".
$HTTP_POST_VARS['category'].", ".
"'".$HTTP_POST_VARS['article_text']."')

// Insert the data obtained from the form into the databse
if ($result = $connector->query($insertQuery)){

// If it worked then...
echo '<center><b>Article added to the database</b></center><br>';

}else{

// If it hasn't worked...
exit('<center>Sorry, there was an error in saving to the database.</center>');

}

include '../html/forms/news_insert_form.html';
?>


The error-
Parse error: syntax error, unexpected $end in _____ on line 35

How can i fix that?
 

Posts in this topic


Closed TopicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: