close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Issue with insert record

Thread began 8/08/2017 12:13 pm by Janet | Last modified 8/08/2017 2:02 pm by Ray Borduin | 249 views | 3 replies |

Janet

Issue with insert record

I have an issue with an insert record script on a page I am building. I have built quite a few using the mSQLi scripts and never had this trouble before. When the form is filled in I get a simple error that says "There is an error in your SQL syntax."

I have been on to tech support on my web host, who have confirmed there is nothing wrong with the settings, and the php error log is not showing any further information as to why it is happening.

I've attached the file in question, and given a link in private to the web page. I have also attached another version of the file that includes recaptcha - it also isbn;t working even though it should, but that gives a different error message, and I thought it might be useful in spotting what's going wrong :)

Sign in to reply to this post

Ray BorduinWebAssist

You should be able to go into your queryobj.php file and change the debug setting to true. That will show the actual error message when inserting instead of the general one you are seeing now. That may help in tracking it down.

Sign in to reply to this post

Janet

yes I did that, and now have the error on screen. I'm still not sure what I have done wrong through.

INSERT INTO INQUIRIES (ID, NAME, ADDRESS, CONTACT_EMAIL, CONTACT_PHONE, HOTEL STAY, DATES_REQUIRED, VEHICLES_REQUIRED, COMMENTS) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)

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 'STAY, DATES_REQUIRED, VEHICLES_REQUIRED, COMMENTS) VALUES (?, ?, ?, ?, ?, ?, ?, ' at line 1

Sign in to reply to this post

Ray BorduinWebAssist

The issue is with the space in the column name. The current version of MySQLi doesn't work with spaces in column names. You can either change the column name to use an underscore, or manually update the code and encapsulate the column name with single quotes to fix the issue for now.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...