doubledee — 2013-04-14T12:25:19-04:00 — #1
Can I use a hyphen in a Table name in MySQL? (e.g. "sub-section" or "sub-section_article")
Or will that break something down the road?
r937 — 2013-04-14T14:41:43-04:00 — #2
yes, you can... but it needs to be properly quoted
doubledee — 2013-04-14T16:26:49-04:00 — #3
Good thing I asked!
So what does that mean in practical terms?
My guess is that I would have to look for any places in my PHP code that has SQL statements, and make sure that those SQL statements use the backtick (`) character around the table name like this...
WHERE blah blah...
r937 — 2013-04-14T16:42:57-04:00 — #4
only if you're a masochist
ask yourself why you really want to do that, when a table name like subsection does not require any special treatment
doubledee — 2013-04-14T16:56:12-04:00 — #5
1.) I am a masochist.
2.) I LIKE hyphens because that make phrases and compound-words easier-to-read, including table-names.
3.) But in this case, I came to the same conclusion as you, before you responded.
"subsection" it shall be!
Sometimes I actually do "bend" in the wind... :lol: