How to connect to DB
| From: | murugesan | Date: | Sat, 16 Aug 2003 11:12:21 +0000 |
| Subject: | How to connect to DB | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159790@lists.php.net to get a copy of this message | ||
Hello all,
I have some existing php pages already. Now I want to change the DB
to point to another DB.
I have changed the include_path in php.ini file to point to /home/config
Also I changed the constant db_name defined in a file in
/home/config/con.php to point to new DB.
[snip]
<<<<<<<<<
include "con.php"
@mysql_pconnect(db_host,db_user,db_pass);
mysql_select_db (db_name) or die ("could not select db");
<<<<<<<<<<
<<<<<<<<<<<<<<<<<
//contents of con.php
<?php
define('db_host','localhost');
define('db_name','newdb') ;
define('db_user','scott') ;
define('db_pass','tiger') ;
define('db_type','mysql') ;
?>
<<<<<<<<<<<<<<
Also I restarted the apache.
But it is still accessing the old DB.
What are all the changes that I have to make. other than these changes.
Regards,
Murugesan.