|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Problem connecting to mysql db hi, I need more pages to access the db. Currently, in every page I have specified the variables needed for the connection, like this: $ host = 'localhost'; $ db_user = 'root'; $ pass = 'root'; $ database = 'db_pro'; However, if for example you change the password to access the db should go to each page to change this value. I tried to create a file containing connection.php these variables and then calling this file in the pages where I need using the require, but it seems not work. How can I do? |
#2
| |||
| |||
Re: Problem connecting to mysql db Quote:
Error that you reported? |
#3
| |||
| |||
Re: Problem connecting to mysql db hi, mysql supports SSL. Did you check your server's logfiles? most implementations try a private key, then revert to password authentication. Starting the server in "verbose" mode also might enlighten you. |
#4
| |||
| |||
Re: Problem connecting to mysql db creates a file called type connection.php <? php $ host = 'localhost'; $ db_user = 'root'; $ pass = 'root'; $ database = 'db_prova'; > then all of your file instead of rewriting these lines, for example in the index.php file type: <? php include ( "connection.php"); BODY OF THE PAGE > Doing so in all your pages, in case you should change the login information (for example if you change your domain or put your code on other web servers) just changing the data in the file only connection.php. You could use this method to simplify your pages and to simplify maintenance of the code (eg. A file with only the menus, one with only the header, one with only the footer). One need only recall it from your php page. |
![]() |
|
Tags: database, mysql, password |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Connecting C# with MySQL database | Quattro | Software Development | 5 | 05-03-2010 10:13 PM |
Connecting to remote MySQL | Gavisht | Software Development | 4 | 10-12-2009 08:35 PM |
Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2 | roshan45 | Software Development | 3 | 07-11-2009 09:36 PM |
Problem connecting to mysql | Damodar | Software Development | 3 | 25-02-2009 03:16 PM |
Connecting VB.net with mysql | Jateen | Software Development | 1 | 05-01-2009 09:37 PM |