Results 1 to 3 of 3

Thread: SQL error

  1. #1
    Join Date
    Jan 2005

    SQL error

    Hi folks,

    Can anyone please tellme why I get this error:

    Could not enter data: 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 ')' at line 1

    Using this statement:

    INSERT INTO events (start, end) values('2012-12-18 00:00:00','2012-12-20 00:00:00')
    It enters fine if I insert it using the query panel in MySQL.

    Can anyone help?

    Many thanks

  2. #2
    Join Date
    Aug 2004
    Just a hunch: try quoting the column names with "back-tick" quotes, in case they are being interpreted as reserved words, e.g.:
    INSERT INTO `events` (`start`, `end`) values('2012-12-18 00:00:00','2012-12-20 00:00:00')
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

  3. #3
    Join Date
    Oct 2010
    Quote Originally Posted by mattastic View Post
    It enters fine if I insert it using the query panel in MySQL.
    Can I ask how / where you are entering it that it is not working? If in an app of some kind (java, php, etc) possibly show the code around where you are executing it and add the query itself to the error message so that you can determine its formatted exactly as you expect it to be.
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles