Jump to content

Pear MDB2 connection problems. All help appreciated


supergrover1981

Recommended Posts

Hi Guys,

I've been using pear on my local machine for the last two weeks or so without any problems - I've just tried to migrate some stuff to a remote (shared) server for the first time, and I'm having a bit of a problem.

I'm trying to connect via MDB2, using the following:
[code]
        $connection = MDB2::connect("mysql://$db_username:$db_password@$db_host/$db_database");
        if (MDB2::isError($connection)) {
        die ("Could not connect to the database: <br />".MDB2::errorMessage($connection));
    }
    ?>
[/code]


which is always met with the dreaded: "Could not connect to the database: not found" error.

However:

- I can connect using the same login details via the non-pear mysql_connect call
- I can connect via MDB2 on my local machine using the same mdb2 code
- I've looked via pear remote-list and MDB2 is installed on the remote machine

Any suggestions would be really, truly appreciated - I'm quite stumped. Connection code attached below. :-)

Many thanks,
- JB
[code]
    php:$db_username='tempscou_testconn';
    $db_password='conntest';
    $db_host='localhost';
    $db_database='tempscou_jts';

    require_once('MDB2.php');

    $connection = MDB2::connect("mysql://$db_username:$db_password@$db_host/$db_database");
        if (MDB2::isError($connection)) {
        die ("FROG1Could not connect to the database: <br />".MDB2::errorMessage($connection));
    }
    ?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.