import MySQLdb

DB_HOST = 'db695391459.db.1and1.com'
DB_USER = 'dbo695391459'
DB_PASS = 'juan2442'
DB_NAME = 'db695391459'

def run_query(query = ''):
	datos = [DB_HOST, DB_USER, DB_PASS, DB_NAME]

	conn = MySQLdb.connect(host='db695391459.db.1and1.com', user='dbo695391459', passwd='juan2442', db='db695391459', port=3306)
	cursor = conn.cursor()
	cursor.execute(query)

	if query.upper().startswith('SELECT'):
		data = cursor.fetchall()
	else:
		conn.commit()
		data = None
	cursor.close()
	conn.close()
	return data

run_query('INSERT INTO PRUEBA (edad) VALUES (4)')