This is the error message you are telling the page to display if the connection fails, so it's a bit tricky to know what is going wrong. Here's some suggestions:
1. Have you checked that you have changed the username and password etc to your one and aren't using what's in the downloaded code?
2. Make sure MySQL is still running - try your chapter 2 code again.
3. Remove the "or die ..." bit from the code so php outputs the actual error message. Note you may need to set display_errors to on at the top of the page, or you may just get a blank screen (
explanation here):
Code:
<?php
ini_set('display_errors', 1);
$db = mysql_connect('localhost', 'bp6am', 'bp6ampass');
// ... rest of code
?>
HTH
Phil