rbragg
03-14-2007, 11:08 AM
This should be a quick fix. I think I've just been staring at the code for too long. This code starts at line 1:
<?php
session_start();
if ( isset ($_SESSION['accepted']) and $_SESSION['accepted'] === TRUE )
{
if( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['confirm']) )
{
include 'connect.php';
$query_insert = "INSERT INTO park_lots (Lot11, Lot21, Lot31, Lot32, Lot33, Lot41, Lot42, Lot43, SportsComplex)".
"VALUES( '".mysql_real_escape_string($_SESSION['drop11'])."', '".mysql_real_escape_string($_SESSION['drop21'])."',
'".mysql_real_escape_string($_SESSION['drop31'])."', '".mysql_real_escape_string($_SESSION['drop32'])."',
'".mysql_real_escape_string($_SESSION['drop33'])."', '".mysql_real_escape_string($_SESSION['drop41'])."',
'".mysql_real_escape_string($_SESSION['drop42'])."', '".mysql_real_escape_string($_SESSION['drop43'])."',
'".mysql_real_escape_string($_SESSION['dropSC'])."', )";
$insert = mysql_query($query_insert); # insert values into table
if (!$insert) # if insertion failed
{
die("Customized Error: FAILED TO SUBMIT - " . mysql_error() );
}
else
{
header("Location: http://hiddenlink.com");
}
mysql_close;
}
?>
I get this error: Customized Error: FAILED TO SUBMIT - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5.
I know that line 5 is a bracket, but I don't see a syntax error anywhere in the above code. Thanks in advance!
<?php
session_start();
if ( isset ($_SESSION['accepted']) and $_SESSION['accepted'] === TRUE )
{
if( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['confirm']) )
{
include 'connect.php';
$query_insert = "INSERT INTO park_lots (Lot11, Lot21, Lot31, Lot32, Lot33, Lot41, Lot42, Lot43, SportsComplex)".
"VALUES( '".mysql_real_escape_string($_SESSION['drop11'])."', '".mysql_real_escape_string($_SESSION['drop21'])."',
'".mysql_real_escape_string($_SESSION['drop31'])."', '".mysql_real_escape_string($_SESSION['drop32'])."',
'".mysql_real_escape_string($_SESSION['drop33'])."', '".mysql_real_escape_string($_SESSION['drop41'])."',
'".mysql_real_escape_string($_SESSION['drop42'])."', '".mysql_real_escape_string($_SESSION['drop43'])."',
'".mysql_real_escape_string($_SESSION['dropSC'])."', )";
$insert = mysql_query($query_insert); # insert values into table
if (!$insert) # if insertion failed
{
die("Customized Error: FAILED TO SUBMIT - " . mysql_error() );
}
else
{
header("Location: http://hiddenlink.com");
}
mysql_close;
}
?>
I get this error: Customized Error: FAILED TO SUBMIT - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5.
I know that line 5 is a bracket, but I don't see a syntax error anywhere in the above code. Thanks in advance!