Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.