RE: [PEAR] problem using Pear's DB layer
| From: | Tim | Date: | Fri, 04 Apr 2003 14:36:42 +0000 |
| Subject: | RE: [PEAR] problem using Pear's DB layer | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4644@lists.php.net to get a copy of this message | ||
this is what i have so far:
--snip--
require_once 'DB.php';
$user = 'root';
$pass = 'zigomushy';
$host = '192.168.0.23';
$db_name = 'spip_marcou';
// Data Source Name: This is the universal connection string
$dsn = "mysql://$user:$pass@$host/$db_name";
print($dsn);
// DB::connect will return a PEAR DB object on success
// or an PEAR DB Error object on error
$db=DB::connect($dsn); // **This is where the problem is**
if (DB::isError($db)) {
die ($db->getMessage());
}
print("connection OK");
--snip--
it prints out the dsn string, but no error is printed afterwards or the string "connection
OK". i have no problem connecting to the
mySQL server with the above access codes.
Thanks
Tim
> -----Message d'origine-----
> De : Christian Joergensen [mailto:mail@phpguru.dk]
> Envoyé : vendredi 4 avril 2003 12:18
> À : tfletcher@netfactoriel.com; pear-general@lists.php.net
> Objet : RE: [PEAR] problem using Pear's DB layer
>
>
> -----Original Message-----
> From: Tim [mailto:tfletcher@netfactoriel.com]
> Sent: Friday, April 04, 2003 12:09 PM
> To: luis; 'Alan Richmond'; pear-general@lists.php.net
> Subject: RE: [PEAR] problem using Pear's DB layer
>
> > when i get the error message using
> > if (DB::isError($db)) {
> > die ($dbTiki->getMessage());
> > }
>
> You need to use the same object as you do the check on:
>
> if (DB::isError($db)) {
> die($db->getMessage());
> }
>
> --
> Christian Jørgensen | In order to understand recursion
> http://www.razor.dk | one must understand recursion.
>
>
>
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>