Spaces in row names?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
robin105
Forum Newbie
Posts: 7
Joined: Tue Mar 24, 2009 8:49 pm

Spaces in row names?

Post by robin105 »

Is there a big problem with allowing spaces in row names? Will it work on all servers?
sujithtomy
Forum Commoner
Posts: 46
Joined: Tue Mar 24, 2009 4:43 am

Re: Spaces in row names?

Post by sujithtomy »

Hello,

You mean spaces in Field-name of tables??
Last edited by sujithtomy on Wed Mar 25, 2009 1:15 am, edited 1 time in total.
robin105
Forum Newbie
Posts: 7
Joined: Tue Mar 24, 2009 8:49 pm

Re: Spaces in row names?

Post by robin105 »

Mmhm :-).
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Spaces in row names?

Post by JAB Creations »

I'm going to have to go with a big fat no. I make an exception in XHTML for files intended for downloads but that's about it. Stick to underscores and or dashes. Don't use underscores in URL's though, you should stick to dashes (as dashes as word separators while underscores are not). I'd recommend underscores for word separation for column names. user_avatar and register_date in example.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: Spaces in row names?

Post by Bill H »

The MySQL docs only say that a space cannot be the last character, but I'm going to echo the "big fat no." I would also echo the use of underscores.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Spaces in row names?

Post by califdon »

I'll join the chorus. Why? Because, even if spaces (or even underscores, for that matter) may be accepted for certain naming purposes in certain software, it's a lethal habit to form because when you migrate to a different environment (and you WILL migrate to a different environment at some point), the habit will cause you unending grief. And for what? There's no good reason to name objects with spaces in them. Thousands of programmers with millions of man-hours of experience have developed many excellent naming conventions that AVOID all these problems. You just need to use them!
Post Reply