Why cant you use the word EXPLAIN in a field name for Mysql Database

Discussion in 'MySQL' started by Dirty-Rockstar, Jul 10, 2009.

  1. #1
    Wow, that just blew my mind(newbie here). I was getting an error for the longest time trying to update a database with a field name explain. Kept saying there was an error with my sql syntax. I almost made a thread here with my code asking why it would not work. I never had to do that in ages. For spite, I changed the name from explain to usermessage and it worked fine.

    So my question is why is that not allowed.
    I think I just answered my own question where the word explain is a keyword in mysql like update or insert to when it ran it assumed that explain was me trying to query or something instead of that being the name of a field.

    am I right?

    one hour of frustration because of a stupid field name. this is a bit of a rant too. damn I was pissed. happy I resolved it.
     
    Dirty-Rockstar, Jul 10, 2009 IP
  2. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #2
    plog, Jul 10, 2009 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    You can use it if you enclose it in `explain` (backticks). Not a good idea, but possible.
     
    jestep, Jul 10, 2009 IP