You seem to be using mysql_select_db() and mysql_db_query. In order to avoid putting an extra parameter(the db name) into all your queries, use mysql_query instead.
I.E.
$iConnection = mysql_pconnect($dbHostname, $dbUsername, $dbPassword);
mysql_select_db($db);
$strQuery = "SELECT * FROM table_name";
mysql_query($strQuery, $iConnection);
The design of this class seems to be off as well, since every time you create a user object, you will be making another connection to the database. Try making the connection in your PHP script before you create the User object. If you want to reuse all the database stuff, I would suggest creating a class (i.e. dbConn) and using mehods like createConnection(), getConnection(), setConnection() all just to handle the connecting to the database..
have methods in the User class like setConnection(), getConnection(), and releaseConnection()
so you could do
$objDBConn = new dbConn();
$objDBConn->createConnection();
$objUser = new User($iUserID, $objDBConn->getConnection());
print $objUser->getUserName();
$objUser->releaseConnection();
I would be wary of doing a "require" inside of a php class. While this may work (I'm not sure if it does), it certainly isn't good practice.
did you remove the "@" before your mysql calls to verify that no errors were returned?
p.