Pear MDB2 connection problems. All help appreciated
Posted: Sun Nov 26, 2006 6:50 am
feyd | Please use
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
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
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: Select all
$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));
}
?>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: Select all
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));
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]