Hi, Im having problems when trying to UPDATE a record in my mysql database. The php form sends data to the database ok but i want the update query to add 1 to the 'placesbooked' column where 'sessionid' = the value in 'hiddenTA'. I receive the following error: Parse error: parse error in /u2/WWW/htdocs/pesdc/confirmation.php on line 59 Here is my code: [code] <?php require_once('Connections/PESDC_MYSQL.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "booking")) { $insertSQL = sprintf("INSERT INTO students (id, TA, TP, FA, FP, forename, surname, email, course, `year`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['id'], "int"), GetSQLValueString($_POST['hiddenTA'], "text"), GetSQLValueString($_POST['hiddenTP'], "text"), GetSQLValueString($_POST['hiddenFA'], "text"), GetSQLValueString($_POST['hiddenFP'], "text"), GetSQLValueString($_POST['hiddenforename'], "text"), GetSQLValueString($_POST['hiddensurname'], "text"), GetSQLValueString($_POST['hiddenemail'], "text"), GetSQLValueString($_POST['hiddencourse'], "text"), GetSQLValueString($_POST['hiddenhiddenyear'], "int")); mysql_select_db($database_PESDC_MYSQL, $PESDC_MYSQL); $Result1 = mysql_query($insertSQL, $PESDC_MYSQL) or die(mysql_error()); $insertGoTo = "confirmed.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "booking")) { $updateSQL = sprintf("UPDATE session SET placesbooked =%s, WHERE sessionid =%s"), GetSQLValueString($_POST['+1'], "int"), GetSQLValueString($_POST['hiddenTA'], "text")); mysql_select_db($database_PESDC_MYSQL, $PESDC_MYSQL); $Result2 = mysql_query($updateSQL, $PESDC_MYSQL) or die(mysql_error()); } mysql_select_db($database_PESDC_MYSQL, $PESDC_MYSQL); $query_Recordset1 = "SELECT * FROM `session`"; $Recordset1 = mysql_query($query_Recordset1, $PESDC_MYSQL) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> [/code] Thanks for any help with this!