If I'm not mistaken, you are using constants not strings for the connection data. If thats the case, it would be more like; [code] define ('DB_HOST','db5.awardspace.com'); define ('DB_NAME','samuelhale_free'); define ('DB_USER','samuelhale_free'); define ('DB_PASSWORD','whatever'); //You can then declare a function to connect to the DB like this function db_connect() { static $connected; if ($connected) return; $connected = true; mysql_connect(DB_HOST, USER, DB_PASSWORD) or error_msg ("User or password incorrect"); mysql_select_db(DB_NAME) or error_msg ("could not locate database"); } // To run a queryy just use db_connect(); //query here[/code]