When I connect to a mysql database, I always just put the user and password in a php file, and include that file for any page I connect on... so here is the user and password file... dbvars.php:
One armed space goat wrote:So you basically do what I do... isn't that a security issue having the database password included in your file?
Depends, are you on a shared host? If you arn't then no one will be able to access your files.
Don't get me wrong, shared hosts can be configured (properly) to prevent this.. depends on your host.
Secondly, reguarding your use of GLOBALS, they are generally bad to use. Why don't you simply move your mysql_connect into your include file and eliminate the globals all together?
Things like that work better (for me) if I define them rather than set them as variables. Variables are meant to be changed--which is why they're called vary-ables.
Skara wrote:Things like that work better (for me) if I define them rather than set them as variables. Variables are meant to be changed--which is why they're called vary-ables.