a) you can make your code a bit terser by getting rid of the if statements and using "or" instead like so:
$dbc = my_sql_connect (DB_HOST, DB_USER, DB_PASSWORD) or trigger_error('Could not connect to MySQL.\n<br />MySQL Error: ' . mysql_error(), E_USER_ERROR);
mysql_select_db (DB_NAME)) or trigger_error('Could not select the database.\n<br />MySQL Error: ' . mysql_error(), E_USER_ERROR);
b) you need to identify the exact line where your code fails. You can do this for example by "commenting out" everything and just "uncomment" a few lines from the top. Or an even better way is using eclipse and xdebug or any other IDE with some advanced debugging functionality.
e.g. for the "commenting out" variant:
<?php # mysql_connect.php
// This file contains the database access information. It also establishes a connection to MySQL and selects the database.
// Set the database access information as constants.
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'sitename');
// $dbc = my_sql_connect (DB_HOST, DB_USER, DB_PASSWORD) or trigger_error('Could not connect to MySQL.\n<br />MySQL Error: ' . mysql_error(), E_USER_ERROR);
//mysql_select_db (DB_NAME)) or trigger_error('Could not select the database.\n<br />MySQL Error: ' . mysql_error(), E_USER_ERROR);
//...more code, that has been commented out
//...still more , that....
If this code does not return errors you know that your first few lines are fine, then remove the // from the next line and so on.
Bjom