Hello, I'm trying to find what characters are allowed to use for server, username, password, and database name(this one is actually from mysql_select_db). I tried to create table with name like !#()_{}'"s@$ and it worked, so I'm totally confused about which characters are allowed and which not allowed. Thanks for advice.
For table names there isn't much that isn't allowed. See http://dev.mysql.com/doc/refman/5.1/en/identifiers.html And a length of 64 chars max. Ofcourse, this is for mysql 5.1. Other restrictions may apply to earlier versions. If you use special characters, like for example + and -, you should use the ` operator so as not to confuse mysql. So you should construct your SQL like so: SELECT * from `jksd@sdj+` Of course, I see no good reason why you'd want to use names such as this..
@premiumscripts: thanks for quick reply, well actually I don't want to use such characters, I need this for creating validation.
Well, ok, in that case i would just allow a-z and _. Seems like most people wouldn't need anything else.