You would need to connect to this other database in the usual PHP way, using mysql_connect() with the appropriate arguments. You can add this in each function in qa-external-users.php, and PHP will automatically re-use the previous connection instead of reconnecting if the parameters are the same.
Make sure you pass the result from your mysql_connect to mysql_query(), instead of the $qa_db_connection parameter, so that your query is run against your database, and not Question2Answer's.