Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot connect to database with PEAR php
    primarykey
    data
    text
    <p>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.</p> <p>I have downloaded the DB package from: <a href="http://pear.php.net/package/DB" rel="nofollow noreferrer">http://pear.php.net/package/DB</a></p> <p>Firstly I have included the package (which works): </p> <pre><code>include 'libs/pear/db/DB.php'; </code></pre> <p>Then I connect with:</p> <pre><code>$dsn = array( 'phptype' =&gt; "mysql", 'hostspec' =&gt; $hostname, 'database' =&gt; $dbname, 'username' =&gt; $username, 'password' =&gt; $password ); $conn = DB::connect($dsn); if (DB::isError ($conn)) die ("Cannot connect: " . $conn-&gt;getMessage () . "\n"); </code></pre> <p>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.</p> <p>Ive tried turning errors on with:</p> <pre><code>ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); </code></pre> <p>And I get:</p> <pre><code>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 </code></pre> <p>Which aren't fatal errors so it shoudldn't cause the script to die??</p> <p>I cannot get to the error logs as GoDaddys web interface just sends me to a not found page.</p> <p>Am I missing packages? Please advise! Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload