mysql_select_db and error trapping added