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('my sql://penguin:top^hat @db.example.com/restaurant');
if (DB::isError($d b)) { 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,
snippet of the book "Learning PHP5":
<?php
error_reporting (E_ERROR | E_WARNING | E_PARSE);
echo "test";
include 'DB.php';
$db = DB::connect('my sql://penguin:top^hat @db.example.com/restaurant');
if (DB::isError($d b)) { 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,
Comment