Dotan Cohen wrote on 2009-10-18 21:21:

I thought that one could not test if a database connection is
established or not, this is the most relevant thing that I found while
googling that:


$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());

So just test if $link is available

All the connections are to MySQL databases, but to _different_ MySQL
databases on the same host.

Would't this solve you problem?

$link1 = mysql_connect('localhost', 'mysql_user1', 'mysql_password');
$link2 = mysql_connect('localhost', 'mysql_user2', 'mysql_password');

if($link1) {

or I would say that your "different scripts" should require different db connection files.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to