Posted by:
SimonT
(---.lightspeed.stlsmo.sbcglobal.net)
It would be better for you to create a Named Constant for the database name in a myconfig.php file you create on your site. You would "require_once" that file in all of your PHP files so that the constants defined in the myconfig.php file will be available to all code.
An example is:
Create a file named myconfig.php (or any other name you want, but one that instantly says "Hey, I'm a configuration file"
and put in the directory with the rest of your PHP files.
Code the following in the file:
define("DBNAME", "name of the database in whatever case is needed for it to work properly"
;
When you want the name of the database, you code DBNAME instead of "the name of the database"
Changing it in the myconfig.php file will "change" it everywhere in your application.
As to manually changing things - there are editors which replace strings in a global find and replace action across multiple files. You could use something like that to change the database name to the name of the defined constant.
Always think in terms of "how can I make this easier to change in the future?"
As to upper or lower case or mixed case on names - it is always better to just stick to lowercase unless absolutely forced - as by some programming language requirement)
Most instances you will run into will be case insensitive and a very few will be case sensitive.
If you stick to lower case you will head off any problems with names in the future.
It is never wise to have two things named the same but with different case. It is far too easy to make a typing error and specify the wrong one.
All programming languages used on the web allow very long variable names. Use that, but don't over do it, and make the names of your variables, and such, meaningful.