Page 1 of 1

How to connect 2 databases in php-sql

Posted: Mon Sep 24, 2007 6:03 pm
by imhoteb
Is ther possible to have 2 php scripts that can share the same line of USER and PASS ?
Can I install that scripts to share like that ?
Do I have to do something else?
[s]pls[/s] please help , I'm new to this.
Thank you
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.

Posted: Mon Sep 24, 2007 6:55 pm
by Christopher
config.php

Code: Select all

<?php

$Config = array(
     'username' => 'xxx',
     'password' => 'yyy',
     );
foo.php

Code: Select all

<?php
include 'config.php';

$db = new DB($Config['username'], $Config['password']);
bar.php

Code: Select all

<?php
include 'config.php';

$db = new DB($Config['username'], $Config['password']);