the no database selected error means that there is a problem with the database connection file. It usually happens if the table being selected in the SQL SELECT statement doesnt exist on the server.
it can also happen if the database being used in the connection file does not exist on the remote MySQL server.
it sounds to me like the DB on the remote server does not have the same set of tables as the DB on the local server.