MySQL reserved keywords (fieldnames)

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 8, 2017   (RSS)

By Deborah - August 4, 2017

Just a question...

With v3.10, when creating a new field titled "Name" in a section editor, I see the CMS Builder alert "Selected fieldname is reserved, please choose another."

The CMS Builder change notes for v3.09 state "MySQL reserved keywords can no longer be used as fieldnames". I found the list of keywords and reserved words for my version of MySQL at dev.mysql.com, so I'm all set there.

My question is, if I upgrade an existing pre-v3.09 installation to use v3.10 and PHP 7+, will there be any issue with field names that are now not allowed? There are several field names I've used frequently on various sites.

Deborah

By Dave - August 8, 2017

Hi Deborah, 

In all cases, you can use reserved words if you put mysql `backtick` characters around them.  So if you run into issues in future you can specify the fieldname like this `name`.  However, in most cases it's unlikely you're going to need to change anything for a long time.  We're just moving towards making things as easy, simple, and universal for the majority of users.  

In the case of "name".  I google'd and it's only used in a very isolated case in mysql and typically should work as a column name without backticks or any special treatment, so I think we'll likely remove it from that list.  

What are the other reserved keywords that you often use as fieldnames?  I can take a look at those as well.

Thanks!

Dave Edis - Senior Developer

interactivetools.com