|
Posted by Schluppy on 01/25/07 06:36
On Wed, 24 Jan 2007 07:49:52 -0800, Charles wrote:
> I installed PHP with PEAR support on my Windows computer. I tried the
> snippet of the book "Learning PHP5":
>
> <?php
> error_reporting(E_ERROR | E_WARNING | E_PARSE);
> echo "test";
> include 'DB.php';
> $db = DB::connect('mysql://penguin:top^hat@db.example.com/restaurant');
> if (DB::isError($db)) { die("Can't connect: " . $db->getMessage( )); }
> ?>
>
> But it only prints "test", it should display an error message saying
> it's not able to connect to the DB. Do you know why nothing happens?
> Also, I think there should be a real "DB.php" file, correct? What
> should I put into this file? Or is it only a line "as is", that doesn't
> mean there needs a "DB.php" file?
> Thanks,
You need to read the docs:
http://pear.php.net/manual/index.php
Specifically:
http://pear.php.net/manual/en/installation.php
--
Schluppy
Navigation:
[Reply to this message]
|