[wp-hackers] hyphens to differentiate database names for WP in mysql

Bearcat Şándor bearcat at feline-soul.com
Mon May 20 19:48:53 UTC 2013


Thanks for the replies!  That's just what i wanted to know.


On Mon, May 20, 2013 at 1:30 PM, Otto <otto at ottodestruct.com> wrote:

> On Mon, May 20, 2013 at 1:40 PM, Cameron Hurd <me at cameronhurd.com> wrote:
> > But, there is that table_prefix variable to facilitate multiple wp
> installs in one db. Any plugin running queries is alreading prepending this
> to table names when running queries. According to the ol' codex, it says
> only numbers, letters and underscores -
> http://codex.wordpress.org/Editing_wp-config.php#table_prefix
> >
> > As for the name of the actual db itself, I don't see why hyphens would
> be bad practice. I think it's just preference.
> >
> > Any other thoughts?
>
> http://dev.mysql.com/doc/refman/5.0/en/identifiers.html
>
> Certain objects within MySQL, including database, table, index,
> column, alias, view, stored procedure, partition, and other object
> names are known as identifiers. This section describes the permissible
> syntax for identifiers in MySQL.
> ...
> An identifier may be quoted or unquoted. If an identifier contains
> special characters or is a reserved word, you must quote it whenever
> you refer to it.
> ...
> Identifiers are converted to Unicode internally. They may contain
> these characters:
>
> Permitted characters in unquoted identifiers:
> ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar,
> underscore)
> Extended: U+0080 .. U+FFFF
>
> Permitted characters in quoted identifiers include the full Unicode
> Basic Multilingual Plane (BMP), except U+0000:
> ASCII: U+0001 .. U+007F
> Extended: U+0080 .. U+FFFF
>
>
> Note that "hyphen" is not in the list of permitted characters for
> unquoted identifiers. WordPress does not use quoted identifiers
> everywhere (although it probably should, I suspect), so hyphens are
> currently a no-no.
>
> Use underscores instead. Safer.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Bearcat M. Şándor
Feline Soul Systems LLC
Voice: 872.CAT.SOUL (872.228.7685)
Fax: 406.235.7070
Jabber/xmpp/gtalk/email: bearcat at feline-soul.net
MSN: bearcatsandor at hotmail.com
Yahoo: bearcatsandor
AIM: bearcatmsandor
My public pgp key is included for verification of my identity


More information about the wp-hackers mailing list