www.webdeveloper.com
Results 1 to 3 of 3

Thread: SQL error

  1. #1
    Join Date
    Jan 2005
    Location
    UK
    Posts
    381

    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:

    Code:
    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
    Location
    Ankh-Morpork
    Posts
    19,235
    Just a hunch: try quoting the column names with "back-tick" quotes, in case they are being interpreted as reserved words, e.g.:
    Code:
    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

    eBookworm.us

  3. #3
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    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.
    ~Ryan
    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