I am trying to insert some form data into a table and keep getting a Pharse error. I have successfully done so using another form and copied/adjusted the code to match the 2nd for but get the error. Not sure if it is because I am trying to submit decimal values and I am obviously missing something. Any help or recommendations would be appreciated!
Thanks!
PHP Code:
<?php session_start(); include("../includes/includes.php"); $sql = "INSERT into price_details (courseid, 9holecostwkdy, 9holecostwknd, 18holecostwkdy, 18holecostwknd, cartfeewkdy, cartfeewknd, junior9holecostwkdy, junior9holecostwknd, junior18holecostwkdy, junior18holecostwknd, senior9holecostwkdy, senior9holecostwknd, senior18holecostwkdy, senior18holecostwknd, drivingrange) VALUES ('$POST_[courseid]', '$POST_[9holecostwkdy]', '$POST_[9holecostwknd]', '$POST_[18holecostwkdy]', '$POST_[18holecostwknd]', '$POST_[cartfeewkdy]', '$POST_[cartfeewknd]', '$POST_[junior9holecostwkdy]', '$POST_[junior9holecostwknd]', '$POST_[junior18holecostwkdy]', '$POST_[junior18holecostwknd]', '$POST_[senior9holecostwkdy]', '$POST_[senior9holecostwknd]', '$POST_[senior18holecostwkdy]', '$POST_[senior18holecostwknd]', '$POST_[drivingrange]')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "Course ID: $_POST[courseid] pricing options have been added successfully. <a href=\"layout_submission_form.php?courseid=$_POST[courseid]\">Click here to add course layout details.</a>"; exit(); ?>
ERROR MESSAGE:
Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/mngolf/public_html/data/courses/pricing_submission.php on line 8
Last edited by chrishirst; 05-05-2011 at 06:16 AM..
|