PonchoX
06-23-2010, 06:24 AM
hi.
learning php.
at part where we connect to database.
2 questions.
1. tutorial has me using "localhost" as 1st argument in mysql_connect, with wamp server on local machine. will i need to change this to my domain name when moving files to production site? .. or will "localhost" still work there?
2. tutorial has me establishing connection mentioned above using "root" user. then in step #2, they select the database. but wouldn't it be better to connect using the desired db, instead of root, by using login credentials for the desired db?
i have vps, and when i create new db in cpanel, i create user name and passwod for each particular database.
feels weird establishing a root connection. i always used to working with database-specific user name and password.
no where do i ever enter the db-specific user name and pw it seems.
do you follow me?
guidance?
i would prefer to user db-specific credentials, not root.
then it would seem like i don't have to specify the db in step #2. (db_select)
learning php.
at part where we connect to database.
2 questions.
1. tutorial has me using "localhost" as 1st argument in mysql_connect, with wamp server on local machine. will i need to change this to my domain name when moving files to production site? .. or will "localhost" still work there?
2. tutorial has me establishing connection mentioned above using "root" user. then in step #2, they select the database. but wouldn't it be better to connect using the desired db, instead of root, by using login credentials for the desired db?
i have vps, and when i create new db in cpanel, i create user name and passwod for each particular database.
feels weird establishing a root connection. i always used to working with database-specific user name and password.
no where do i ever enter the db-specific user name and pw it seems.
do you follow me?
guidance?
i would prefer to user db-specific credentials, not root.
then it would seem like i don't have to specify the db in step #2. (db_select)