In response to @Pondlife's last comment above and since he has not made it an answer I will do it for him until he posts it himself.
@Pondlife comment:
I have no experience with Azure myself, but the error message is very clear: you can't change databases with USE in SQL Azure. I don't know how or if you can prevent your particular client libraries issuing a USE command, but I would try removing the mssql_select_db() call completely and specify the correct database name in your ODBC DSN. Hopefully that will connect you directly to the database you want to use. - PondLife