dreampho Posted May 3, 2011 Share Posted May 3, 2011 Hi. I am new to PHP, and am having some difficulty with a script. I am getting this error: exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'group(tuition_location, duration, participants, first_name, surname, address_1, ' at line 1' in /home/davidcla/public_html/bookingformengine_group.php:31 Stack trace: #0 /home/davidcla/public_html/bookingformengine_group.php(31): PDOStatement->execute(Array) #1 {main} I think the error is here: $execution->execute(array('tuition_location' => $_POST['tuition_location'], 'duration' => $_POST['duration'], 'participants' => $_POST['participants'], 'first_name' => $_POST['first_name'], 'surname' => $_POST['surname'], 'address_1' => $_POST['address_1'], 'address_2' => $_POST['address_2'], 'address_city' => $_POST['address_city'], 'address_county' => $_POST['address_county'], 'address_country' => $_POST['address_country'], 'address_postcode' => $_POST['address_postcode'], 'email' => $_POST['email'], 'primary_phone' => $_POST['primary_phone'], 'secondary_phone' => $_POST['secondary_phone'], 'additional_name_1' => $_POST['additional_name_1'], 'additional_name_2' => $_POST['additional_name_2'], 'additional_name_3' => $_POST['additional_name_3'], 'additional_name_4' => $_POST['additional_name_4'], 'experience' => $_POST['experience'], 'interest_landscape' => $_POST['interest_landscape'], 'interest_seascape' => $_POST['interest_seascape'], 'interest_architecture' => $_POST['interest_architecture'], 'interest_photoshop' => $_POST['interest_photoshop'], 'additional' => $_POST['additional'])); can anyone tell me if anything is wrong with this code? Thanks Link to comment https://forums.phpfreaks.com/topic/235435-error-help/ Share on other sites More sharing options...
dmikester1 Posted May 3, 2011 Share Posted May 3, 2011 Hard to say w/o seeing the rest of your code. But it looks like it's trying to run some sort of SQL query and the SQL syntax is wrong. Can you echo out the query before it gets run and then test that query manually against your database? That's what I usually do when I have SQL errors. Mike Link to comment https://forums.phpfreaks.com/topic/235435-error-help/#findComment-1209994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.