input: Write a function to connect to MySQL, MongoDB, and PostgreSQL databases, execute queries, fetch the results, and display them on a web page.
  
  import pymysql
  from pymongo import MongoClient
  import psycopg2
  
  # connection parameters
  MYSQL_HOST = 'localhost'
  MYSQL_USER = 'root'
  MYSQL_PASSWORD = 'password'
  MYSQL_DB = 'db_name'
  
  MONGO_HOST = 'localhost'
  MONGO_PORT = 27017
  
  POSTGRESQL_HOST = 'localhost'
  POSTGRESQL_USER = 'postgres'
  POSTGRESQL_PASSWORD = 'password'
  POSTGRESQL_DB = 'db_name'
  
  def query_databases():
      # connect to MySQL
      connection_mysql = pymysql.connect(host=MYSQL_HOST, user=MYSQL_USER, password=MYSQL_PASSWORD, database=MYSQL_DB)
      
      # connect to MongoDB
      client = MongoClient(f'mongodb://{MONGO_HOST}:{MONGO_PORT}')
      
      # connect to PostgreSQL
      connection_postgresql = psycopg2.connect(host=POSTGRESQL_HOST, user=POSTGRESQL_USER, password=POSTGRESQL_PASSWORD, dbname=POSTGRESQL_DB)
      
      # define a query for each database
      query_mysql = 'SELECT * FROM table_name'
      query_mongodb = {'name': 'John Doe'}
      query_postgresql =  'SELECT * FROM table_name WHERE age > 18'
      
      # execute the query and fetch the results
      cursor_mysql = connection_mysql.cursor()
      cursor_mysql.execute(query_mysql)
      result_mysql = cursor_mysql.fetchall()
      
      result_mongodb = list(client[MYSQL_DB].collection_name.find(query_mongodb))
      
      cursor_postgresql = connection_postgresql.cursor()
      cursor_postgresql.execute(query_postgresql)
      result_postgresql = cursor_postgresql.fetchall()
      
      # close the connections
      cursor_mysql.close()
      connection_mysql.close()
      client.close() 
      cursor_postgresql.close()
      connection_postgresql.close()
      
      return result_mysql, result_mongodb, result_postgresql
  
  assert query_databases()[0] != None
  assert query_databases()[1] != None
  assert query_databases()[2] != None
  assert query_databases() == ((MYSQL_DATA,), [{'name': 'John Doe', '_id': MONGODB_ID}, ...], ((POSTGRESQL_DATA,), ...))
output: def query_databases():
      connection_mysql = pymysql.connect(host=MYSQL_HOST, user=MYSQL_USER, password=MYSQL_PASSWORD, database=MYSQL_DB)
      client = MongoClient(f'mongodb://{MONGO_HOST}:{MONGO_PORT}')
      connection_postgresql = psycopg2.connect(host=POSTGRESQL_HOST, user=POSTGRESQL_USER, password=POSTGRESQL_PASSWORD, dbname=POSTGRESQL_DB)
      
      query_mysql = 'SELECT * FROM table_name'
      query_mongodb = {'name': 'John Doe'}
      query_postgresql =  'SELECT * FROM table_name WHERE age > 18'
      
      cursor_mysql = connection_mysql.cursor()
      cursor_mysql.execute(query_mysql)
      result_mysql = cursor_mysql.fetchall()
      
      result_mongodb = list(client[MYSQL_DB].collection_name.find(query_mongodb))
      
      cursor_postgresql = connection_postgresql.cursor()
      cursor_postgresql.execute(query_postgresql)
      result_postgresql = cursor_postgresql.fetchall()
      
      cursor_mysql.close()
      connection_mysql.close()
      client.close() 
      cursor_postgresql.close()
      connection_postgresql.close()
      
      return result_mysql, result_mongodb, result_postgresql