RE: [PEAR] PEAR DB Error
| From: | Chris Mulcahy | Date: | Mon, 23 Apr 2001 21:41:29 +0000 |
| Subject: | RE: [PEAR] PEAR DB Error | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-77@lists.php.net to get a copy of this message | ||
Wow. Ever read something 27 times and see things that weren't there? I
could have sworn I saw a $dsn. <grin>
Thank you very much, Tomas and Joao. It's working now.
Chris
-----Original Message-----
From: Joao Prado Maia [mailto:jpm@phpbrasil.com]
Sent: Monday, April 23, 2001 4:02 PM
To: Chris Mulcahy
Cc: pear-general@lists.php.net
Subject: RE: [PEAR] PEAR DB Error
On Mon, 23 Apr 2001, Chris Mulcahy wrote:
> Well, the exact code I'm using is:
> <?
> require_once 'DB.php';
> $user = 'myuser';
> $pass = 'mypass';
> $host = 'localhost';
> $dbname = 'workout';
>
> $dsn = "mysql://$user:$pass@$host/$dbname";
>
> echo "About to connect!<br>$dsn<br>";
> $db = DB::connect(dsn, array("debug" => 2));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As Tomas said on his first email, you forgot the '$' before the $dsn
variable right there. See? :)
Joao
--
João Prado Maia <jpm@phpbrasil.com>
http://phpbrasil.com - php com um jeitinho brasileiro