RE: [PEAR] Problem of connection
| From: | LIMBOURG Arnaud | Date: | Wed, 20 Nov 2002 12:57:10 +0000 |
| Subject: | RE: [PEAR] Problem of connection | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2768@lists.php.net to get a copy of this message | ||
Apparently DB isn't installed correctly, the it has to be is
Please use the pear command and do a pear install DB, it seems you have
installed the version from CVS.
The correct install is as follows
path/to/pear/DB.php
path/to/pear/DB/common.php
path/to/pear/DB/mysql.php
etc. for all drivers
What you need is require_once 'DB.php'; instead of include 'DB/DB.php';
Arnaud.
<?php
> include 'DB/DB.php';
> $user = 'nome_user';
> $pass = 'password';
> $host = 'localhost';
> $db_name = 'nome_db';
>
> echo "prima della connessione<br>";
>
> $dsn = "mysql://$user:$pass@$host/$db_name";
> echo $dsn;
>
> $db = DB::connect($dsn, true);
> echo $db,"connessione effetuata";
>
>
> if (DB::isError($db)) {
> die ($db->getMessage());
> }
>
> $db->disconnect();
> echo "disconnessione effetuata";
>
> ?>
> -------------------------------------------------------------------
> This is my result page:
>
>
> prima della connessione
> mysql://nome_user:password@localhost/nome_db
>
>
> so when arrive to the connection make nothing more, the
> connection don't
> goes but why i get not errors?
> Somebody can help me? PLEASE i start to become crazy!
>
> I think depende of the configuration of PHP on the server, and i have
> understand that non depende from smarty because with a normal
> template
> without connection on db goes all good.
>
> GRAZIE
> milo
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>