Im having a little trouble connecting to a database with PEAR on my GoDaddy hosting account. I am able to connect to my database with the standard mysql_connect.
I have downloaded the DB package from: http://pear.php.net/package/DB
Firstly I have included the package (which works):
include 'libs/pear/db/DB.php';
Then I connect with:
$dsn = array(
'phptype' => "mysql",
'hostspec' => $hostname,
'database' => $dbname,
'username' => $username,
'password' => $password
);
$conn = DB::connect($dsn);
if (DB::isError ($conn))
die ("Cannot connect: " . $conn->getMessage () . "\n");
However, it does not work. In fact if I put a die inbetween $conn = DB::connect($dsn); and if (DB::isError ($conn)), it does not show. Its like the script ends on the DB::connect.
Ive tried turning errors on with:
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
And I get:
Strict Standards: Non-static method DB::connect() should not be called statically in /path/t.php on line 27
Strict Standards: Non-static method DB::parseDSN() should not be called statically in /path/DB.php on line 520
Which aren't fatal errors so it shoudldn't cause the script to die??
I cannot get to the error logs as GoDaddys web interface just sends me to a not found page.
Am I missing packages? Please advise! Thanks.