Cannot connect to database with PEAR php

gefcda

New Member
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/DBFirstly I have included the package (which works): \[code\]include 'libs/pear/db/DB.php';\[/code\]Then I connect with:\[code\]$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");\[/code\]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:\[code\]ini_set('display_errors',1);error_reporting(E_ALL|E_STRICT);\[/code\]And I get:\[code\]Strict Standards: Non-static method DB::connect() should not be called statically in /path/t.php on line 27Strict Standards: Non-static method DB::parseDSN() should not be called statically in /path/DB.php on line 520\[/code\]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.
 
Back
Top