Do you have the require once line of code for you connection before the query on the page? If not this could be the problem. When you get this error it is telling you that the variable that is being referenced in the mysql_select_db is not valid. This variable should be set in the connection file that you have, so long as it is included on the page before this code you should not get this error.